Every official OpenAI library works; only base_url changes. Examples use gpt-5.6-sol; for the Astra package use gpt-astra.
Chat Completions
base_url must include /v1 and must not end with /. The library appends /chat/completions itself.
Responses follow the OpenAI schema exactly: id is chatcmpl-..., usage has prompt_tokens, completion_tokens and completion_tokens_details.reasoning_tokens. Quota is charged exactly usage.total_tokens.
Responses API
Codex and newer SDKs use this protocol. The reasoning setting lives in reasoning.effort.
Reasoning effort
With Chat Completions use reasoning_effort (low, medium, high). Unset, the gateway uses high. For simple tasks set low to save tokens:
reasoning_effort is Chat Completions only. With the Responses API use reasoning: {"effort": ...}; sending reasoning_effort to /v1/responses is rejected with “Unsupported parameter”.
Streaming
On hard questions the model may think for a while before the first token. Use stream: true so the connection is not dropped. stream_options.include_usage makes the last chunk carry usage so you can reconcile quota yourself.
Sending images (vision)
Images go in the content array, as a public URL or base64 for local files.
Images cost tokens by size. Crop to the relevant part instead of sending a full 4K screenshot.
Models and quota via API
subscription returns the total in hard_limit_usd; usage returns what was used in total_usage, in cents (divide by 100 before comparing). The check page does this for you.