API overview
Copy Page as Markdown
SubQ provides an OpenAI-compatible API with two inference endpoints. Existing Chat Completions clients can switch by changing the base URL and API key, then passing a SubQ model ID in the request body.
Request flow
- Create an account at console.subq.ai
- Generate an API key from the console
- Set the SubQ base URL in your HTTP client or OpenAI SDK
- Choose an endpoint and send a request using a SubQ model.
- Enable streaming when your product needs tokens as they are generated
Base URL
Send API requests to:
https://api.subq.ai/v1The documented endpoints use OpenAI-compatible request and response shapes. Treat the pages in this documentation as the contract for the supported model, fields, and response formats.
Which endpoint?
| Chat Completions | Responses API | |
|---|---|---|
| Conversation state | You send full messages[] each request | Server stores history; pass previous_response_id |
| Best for | Drop-in OpenAI migrations, custom message assembly | Multi-turn apps, long-context workflows, simpler clients |
| System prompt | system role in messages | instructions (per-turn; not inherited) |
| Built-in web search | Not available | tools: [{ "type": "web_search_preview" }] |
| Structured output | response_format | text.format (flattened shape) |
| File input | file parts (file_data or file_id) | input_file parts (file_id only) |
| Reasoning effort | reasoning_effort | reasoning.effort |
| Stream terminator | data: [DONE] | response.completed event |
Prefer Responses for high-stakes multi-turn work — diligence,
compliance review, and agent loops over long documents — where server-managed state,
system instructions, and optional web grounding matter more than hand-rolled messages[].
Next steps
- Use the Quickstart to verify your API key with
curl. - Read Authentication before wiring credentials into an app.
- Review SubQ capabilities in Models.
- Put documents in a prompt with Sending files.
- Return schema-constrained JSON with Structured outputs.
- Connect models to your app with Function calling.
- Build against the Chat Completions API or Responses API (instructions + web search).