what you send
regular input is billed at the selected offer’s input rate.
the ai api marketplace
one model, different providers. compare prices and capabilities, choose a channel or let routing make the choice.
https://api.2api.me/v1responses follow the endpoint you call
choose a channel without changing your integration
input, output and cache at the selected offer’s rates
01 a route for your task
have a provider in mind? go direct. prefer a better price or a faster response? set your priority and let 2api find the route.
one model. different channels.
routing illustration, not live market offerswhy channel ccompare input and output rates at a 1:1 ratio across eligible offers.
compatibility and availability come first. if history is insufficient, this example permits a price-based choice. the model stays the same.
use the openai sdk for chat completions. set the 2api address, your key and a model from the market.
compare channel rates, context and capabilities.
store it server-side in TWOAPI_API_KEY.
the example follows the routing diagram above.
curl --fail-with-body https://api.2api.me/v1/chat/completions \
-H "Authorization: Bearer $TWOAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "provider/model",
"messages": [
{
"role": "user",
"content": "Hello!"
}
],
"max_completion_tokens": 1024,
"routing": {
"strategy": "smart",
"priority": "price",
"allow_unrated": true
}
}'
replace provider/model with a model ID from the market. tools, streaming and other parameters depend on the offer.
X-2api-Listing-IDthe response header identifies the selected offer. your workspace keeps the request and its cost.
02know what you pay for
each offer has its own usd rates per 1 million tokens. buyer prices already include the service fee.
compare market pricesregular input is billed at the selected offer’s input rate.
cache reads have a separate rate. the same tokens are not billed again as regular input.
the response and provider-reported reasoning tokens. reasoning is not counted twice.
a temporary hold, not the request price
the final charge may exceed the reservation.
valid response: settle actual usage and release the unused reservation.
channel error or invalid usage: release the reservation without a charge.
if you close a stream after it starts, we finish reading the generation within the request deadline and charge its actual usage.
settlement & release details03 behind an approval
verification is built into the marketplace. adding an endpoint alone does not grant permission to sell.
check the public https address and authentication. the submitted key must work and a random key must be rejected.
check declared tools, json and other capabilities. unsupported parameters appear in the offer details.
we check response structure, streaming and usage fields. an attractive price should not hide inaccurate accounting.
published models are rechecked without advance notice. each model is approved separately.
tests reduce substitution risk, but cannot guarantee a model’s origin. ambiguous results need further review.
methodology & key security04 for those who provide access
list your models, manage your offers and reach customers. we take care of marketplace integration and verification.
connect a channelyour endpoint, key and model list. the key is stored encrypted.
each model is checked separately. models that do not pass cannot be sold.
set input, output and cache rates. the buyer price includes a 9% service fee on top of your rate.
find technical details in the docs. need help connecting? talk to us.
@sup_2apiboth. compare independent channel offers on the market, then use one 2api address and your api key in code.
on the model market. rates, context and parameters belong to a specific offer. the same model name does not imply identical capabilities across channels.
yes. direct pins an offer using listing_id. smart chooses an eligible offer by price, speed or rating. pass routing in the request or save a rule for your api key.
on HTTP 5xx before the response starts, smart can try another compatible channel of the same model. direct, 4xx errors, timeouts and interrupted responses do not switch automatically. the failed attempt’s reservation is released.
no. technical tests check api behavior, response formats, token accounting and declared capabilities. they help detect issues but do not prove model origin. published models are also checked again.
no. channel keys are encrypted at rest on the server. the public catalog excludes the key, endpoint and seller contact. buyers use their own 2api key.