the ai api marketplace

every model.
one api.

one model, different providers. compare prices and capabilities, choose a channel or let routing make the choice.

base_urlhttps://api.2api.me/v1
connect with the openai sdkrequest example
01 / apichat completions · messages · responses

responses follow the endpoint you call

02 / routingautomatic or direct

choose a channel without changing your integration

03 / usagepay for actual tokens

input, output and cache at the selected offer’s rates

01 a route for your task

one model.
more than one way in.

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 offers
your projectone api key
2api/v1
prioritize

why 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.

integration

your code.
a new address.

use the openai sdk for chat completions. set the 2api address, your key and a model from the market.

  1. 01
    choose a model

    compare channel rates, context and capabilities.

  2. 02
    create an api key

    store it server-side in TWOAPI_API_KEY.

  3. 03
    send a request

    the example follows the routing diagram above.

parameters & limitations
POST/v1/chat/completions
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
  }
}'
terminalrequest example

replace provider/model with a model ID from the market. tools, streaming and other parameters depend on the offer.

which channel answered?X-2api-Listing-ID

the response header identifies the selected offer. your workspace keeps the request and its cost.

02know what you pay for

pay for tokens.
see which ones.

each offer has its own usd rates per 1 million tokens. buyer prices already include the service fee.

compare market prices
input

what you send

regular input is billed at the selected offer’s input rate.

cache

what comes from cache

cache reads have a separate rate. the same tokens are not billed again as regular input.

output

what is generated

the response and provider-reported reasoning tokens. reasoning is not counted twice.

per-request reservationup to $0.05

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 details

03 behind an approval

more than
a model list.

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.

tests reduce substitution risk, but cannot guarantee a model’s origin. ambiguous results need further review.

methodology & key security
2api / verification protocol01 / 04
connection verification preview

04 for those who provide access

your infrastructure. your price.

you supply the api.
you set the price.

list your models, manage your offers and reach customers. we take care of marketplace integration and verification.

connect a channel
  1. 01

    connect

    your endpoint, key and model list. the key is stored encrypted.

  2. 02

    get verified

    each model is checked separately. models that do not pass cannot be sold.

  3. 03

    go to market

    set input, output and cache rates. the buyer price includes a 9% service fee on top of your rate.

still have questions?

find technical details in the docs. need help connecting? talk to us.

@sup_2api
a model store or an api?

both. compare independent channel offers on the market, then use one 2api address and your api key in code.

where are prices and available models?

on the model market. rates, context and parameters belong to a specific offer. the same model name does not imply identical capabilities across channels.

can i choose a channel myself?

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.

what happens if a channel fails?

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.

does verification guarantee model identity?

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.

can buyers see my channel key?

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.

fewer limits. more choice.

your next request.
on your terms.

get an api key