Skip to main content
This page shows the shortest practical call flow: verify your API key first, then send your first model request. The examples use the standard OpenAI-compatible entry point, which is the recommended starting point for new integrations, backend services, and command-line debugging. Before you start, prepare: If you are not sure which header to use, read Authentication first.

1. Set Environment Variables

Put the base URL and API key into environment variables so the following examples can be copied directly.
Windows PowerShell:

2. List Models

Start with GET /v1/models. This does not generate model output, so it is the safest first call for checking your API key, account status, and available models.
If the request succeeds, the response contains the models your account can access. Choose the model value in later requests from this response. You can also retrieve one model:
If this step fails, start with these checks:

3. Send Your First Chat Request

Use POST /v1/chat/completions for the first inference request. It follows the OpenAI Chat Completions shape and has a small, easy-to-debug request body.
Request body fields: A successful response usually contains choices; the model output is in choices[0].message.content.
The sample response only shows the key fields. Real responses may also include id, object, created, model, usage, and other fields.

4. Enable Streaming

Set stream to true if you want to receive tokens as they are generated.
Streaming is useful for chat UIs, long generation tasks, and any workflow that should show the first output quickly. Your client should read the response incrementally using Server-Sent Events or a compatible streaming parser.

5. Responses Example

If your client already targets the OpenAI Responses style, call POST /v1/responses.
The project also exposes a context-compaction endpoint:
Whether a model supports Responses or compaction depends on the available backend channel configuration. If the request returns a model or channel availability error, switch to a model returned by GET /v1/models.

6. Compatibility Examples

If you already have a Claude or Gemini SDK, you can use the compatible entry points for a first smoke test. Claude Messages example:
Gemini model-list example:
You can also use the query-string key form:
Compatibility entry points may use different authentication headers and response shapes from the standard /v1/* API. See Compatibility Formats for details.

7. Next Steps

After your first request succeeds, continue with:

References