For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DashboardSign Up
  • Getting Started
    • Welcome
    • Quick Start
    • Authentication
  • Native Mode
    • Overview
    • OpenAI
    • Anthropic
    • Gemini
  • Unified Mode
    • Overview
    • Python
    • TypeScript
    • cURL
  • Platform
    • Key Management
    • Rate Limits & Budgets
    • Usage & Billing
    • Error Reference
  • API Reference
      • POSTChat completion (any provider)
DashboardSign Up
API ReferenceUnified Mode

Chat completion (any provider)

POST
/v1/chat/completions
POST
/v1/chat/completions
$curl -X POST https://api.trygateway.ai/v1/chat/completions \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "model": "openai/gpt-4o",
> "messages": [
> {
> "role": "system",
> "content": "string"
> }
> ]
>}'
200Successful
1{
2 "id": "string",
3 "object": "string",
4 "created": 1,
5 "model": "string",
6 "choices": [
7 {
8 "index": 1,
9 "message": {
10 "role": "string",
11 "content": "string"
12 },
13 "finish_reason": "string"
14 }
15 ],
16 "usage": {
17 "prompt_tokens": 1,
18 "completion_tokens": 1,
19 "total_tokens": 1
20 }
21}

Send an OpenAI-compatible request and Gateway AI routes it to the right provider. Use provider/model format (e.g. openai/gpt-4o, anthropic/claude-sonnet-4-6, google/gemini-2.5-flash) or a plain model name for well-known models. Set stream: true for server-sent event streaming.

Was this page helpful?
Previous

OpenAI

Next
Built with

Authentication

AuthorizationBearer

Your proxy key (starts with sk-proxy-…). Create one in the dashboard at app.trygateway.ai.

Request

This endpoint expects an object.
modelstringRequired

Provider and model (e.g. openai/gpt-4o, anthropic/claude-sonnet-4-6, google/gemini-2.5-flash)

messageslist of objectsRequired
streambooleanOptionalDefaults to false
temperaturedoubleOptional
max_tokensintegerOptional

Response

Chat completion response (OpenAI-compatible format)

idstring
objectstring
createdinteger
modelstring
choiceslist of objects
usageobject