Source: https://01router.com/docs/models/gemini-3.8-flash/chat Base URL: https://01router.com/api/v1 # Gemini 3.8 Flash · Chat completions Chat models (GPT, Claude, Gemini, Grok, DeepSeek…) use the OpenAI Chat Completions format, so the official OpenAI SDKs work with base URL https://01router.com/api/v1. Set "stream": true for server-sent events. Credits for the prompt plus max_tokens (4,096 when unset) are held first, then settled to the real token usage once the reply ends; the same request id appears in the X-Gateway-Request-Id header and the task log. `POST /api/v1/chat/completions` Bearer API key ## Input parameters | Field | Type | Required | Description | Constraints | | --- | --- | --- | --- | --- | | model | string | yes | Model slug from the catalog. Project keys may use a project-specific model slug. | options: [ "gemini-3.8-flash" ] | | messages | object[] | yes | Non-empty message array with role and content; content may contain supported multimodal parts. | | | provider | string | no | Optional provider slug. Omit for automatic routing; project settings may pin the provider. | | | project | string | no | Optional project ID. Use its published model catalog and routing configuration. | | | stream | boolean | no | Default false. true returns text/event-stream chunks and ends with data: [DONE]. | default: false | | max_tokens | integer | no | Positive integer. Default 4096. Do not combine with max_completion_tokens. | default: 4096; min: 1 | | max_completion_tokens | integer | no | Positive integer. Default 4096. Do not combine with max_completion_tokens. | | | temperature | number | no | OpenAI-compatible sampling, tools and structured output fields depend on the selected model and provider. Only n = 1 is supported. | | | tools | object[] | no | OpenAI-compatible sampling, tools and structured output fields depend on the selected model and provider. Only n = 1 is supported. | | | response_format | object | no | OpenAI-compatible sampling, tools and structured output fields depend on the selected model and provider. Only n = 1 is supported. | | ## Response fields | Field | Type | Required | Description | Constraints | | --- | --- | --- | --- | --- | | id | string | — | Generation ID returned by the create request. | | | object | string | — | chat.completion / chat.completion.chunk | | | model | string | — | Model slug from the catalog. Project keys may use a project-specific model slug. | | | choices | array | — | Completion choices. Non-streaming replies use choices[].message; streaming chunks use choices[].delta. | | | usage | object | — | prompt_tokens, completion_tokens and total_tokens. Streaming includes usage when supplied by the provider. | | ## cURL ```bash curl 'https://01router.com/api/v1/chat/completions' \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3.8-flash", "messages": [ { "role": "user", "content": "Hello!" } ], "max_tokens": 512, "stream": false }' ``` ## 200 · application/json ```json { "id": "chat_example", "object": "chat.completion", "model": "gemini-3.8-flash", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello!" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 8, "completion_tokens": 2, "total_tokens": 10 } } ``` ## SSE · stream: true ```text data: {"id":"chat_example","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Hello!"},"finish_reason":null}]} data: [DONE] ``` ## Usage notes - OpenAI-compatible sampling, tools and structured output fields depend on the selected model and provider. Only n = 1 is supported.