Your First Request
This walkthrough sends a single chat completion, inspects the response, and points you at the most useful next steps. It assumes you already have an API key — if not, follow Authentication first.Send a request
The endpoint isPOST /v1/chat/completions. The body is JSON, the auth header is required, and the request is OpenAI-compatible, so any SDK or tutorial that works against api.openai.com works here too.
Anatomy of the response
id
A unique identifier for this completion. Useful for log correlation, support tickets, and idempotency tracking.
model
The exact upstream model that handled the request. May differ from the alias you sent if the gateway routes to a newer revision.
choices
An array of one or more completions. The default
n=1 returns a single element. Each entry has a message and a finish_reason such as stop, length, or tool_calls.usage
Token counts for prompt and completion. Use these numbers to estimate cost and to enforce per-request budgets in your application.
Make it interactive
The same request is straightforward from Python or JavaScript:You can keep using the OpenAI SDK, LangChain, LlamaIndex, or any other library that targets the OpenAI HTTP API. Just point the base URL at
https://api.getinfinityblue.com/v1.Recommended next steps
- Read Error Handling to learn how the gateway reports failures and how to retry safely.
- Try Streaming to start returning tokens to your UI as soon as they are produced.
- Use Model Selection to pick the right model for your latency, cost, and capability constraints.
- Send images alongside text with Multimodal Input.