ai

OpenAI-compatible chat completions across every frontier...

OpenAI-compatible chat completions across every frontier model on one endpoint — GPT-5, Claude, Gemini, Grok, DeepSeek, Llama, Mistral and ~290 more. POST { model, messages, max_tokens?, temperature?, top_p?, stop? } and get back a standard chat.completion (choices[].message + usage). Pay per call in USDC via x402 — no accounts, no provider keys, no subscriptions. Price scales with the model and max_tokens and is quoted in the 402. List selectable models at GET /api/ai/models. Billing: payment settles before this endpoint runs (paid upstream), so an error after settlement IS charged — the error response then carries the payment receipt (PAYMENT-RESPONSE) and X-2s-Charged: true. upto-scheme payments settle only after success.

post/api/ai/chat

Request

  • Base URL: https://2s.io
  • URL: https://2s.io/api/ai/chat
  • Auth: API key in header PAYMENT-SIGNATURE

Request body

modelstring required

Gateway model id, e.g. openai/gpt-5, anthropic/claude-opus-4.8, google/gemini-3-pro-preview. Full list: GET /api/ai/models.

max_tokensinteger

Max output tokens (default 512).

temperaturenumber

Temperature.

top_pnumber

Top p.

Response

OK

Changes

No recorded changes to this operation across all 1 revision of this API.