Generate text
PreviewCopy Page as Markdown
SubQ Savant (subq-savant-1.4) generates text over up to 4M tokens of
context, and reasons before it answers. Call it with the OpenAI SDK, with the
base URL set to https://api.subq.ai/v1, on either endpoint below.
Choose an endpoint
Use Chat Completions if you already have a Chat Completions client or build the message list yourself. Use Responses for multi-turn work, where SubQ keeps the history for you.
| Chat Completions | Responses API | |
|---|---|---|
| Conversation state | You send the full messages[] each request | Server stores history; continue with previous_response_id or conversation |
| System prompt | system role in messages | instructions (per turn, not inherited) |
| Built-in web search | Not available | tools: [{ "type": "web_search_preview" }] |
| Function calling | Nested shape ({"type":"function","function":{...}}) | Flattened shape ({"type":"function","name":...}) |
| Structured outputs | response_format | text.format (flattened shape) |
| File input | file parts (file_data or file_id) | input_file parts (file_id only) |
| Reasoning effort | Top-level reasoning_effort | Nested reasoning.effort |
| Output cap | max_tokens | max_output_tokens |
| Stream terminator | data: [DONE] | response.completed event |
Send a request
The same question on each endpoint. On Chat Completions:
cURLTypeScriptPython
The answer is in choices[0].message.content:
You need to give 90 days' written notice.On Responses:
cURLTypeScriptPython
The answer is in output_text. The OpenAI SDKs build it from the message
items and skip the reasoning item that usually comes first, so don't read
output[0]. With tools, take the last message instead. See
Extracting the assistant text.
Control reasoning and length
- Reasoning effort:
low,high(the default), ormax. Reasoning can't be turned off. Reasoning tokens are billed as output tokens. See Reasoning effort. - Output cap: reasoning and the answer share one allowance, so a low cap can end before any visible answer. See Token limits.
- Reasoning text comes back apart from the answer. Parse only the answer. See Reasoning output.
Continue a conversation
- Chat Completions: append the assistant's reply and the next user message
to
messages, and send the whole list again. - Responses: send only the new
inputwith the last response'sidasprevious_response_id. Resendinstructionseach turn. See Multi-turn conversations.
Next steps
- Sending files: ask about PDFs and other documents.
- Structured outputs: get JSON that matches your schema.
- Function calling: let the model call your code.
- Use Savant in a coding agent: set up OpenCode, VS Code, or another OpenAI-compatible agent.