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.2. List Models
Start withGET /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.
model value in later requests from this response.
You can also retrieve one model:
3. Send Your First Chat Request
UsePOST /v1/chat/completions for the first inference request. It follows the OpenAI Chat Completions shape and has a small, easy-to-debug request body.
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
Setstream to true if you want to receive tokens as they are generated.
5. Responses Example
If your client already targets the OpenAI Responses style, callPOST /v1/responses.
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:/v1/* API. See Compatibility Formats for details.