Skip to Content

Generate text

Preview
Copy 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 CompletionsResponses API
Conversation stateYou send the full messages[] each requestServer stores history; continue with previous_response_id or conversation
System promptsystem role in messagesinstructions (per turn, not inherited)
Built-in web searchNot availabletools: [{ "type": "web_search_preview" }]
Function callingNested shape ({"type":"function","function":{...}})Flattened shape ({"type":"function","name":...})
Structured outputsresponse_formattext.format (flattened shape)
File inputfile parts (file_data or file_id)input_file parts (file_id only)
Reasoning effortTop-level reasoning_effortNested reasoning.effort
Output capmax_tokensmax_output_tokens
Stream terminatordata: [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), or max. 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 input with the last response's id as previous_response_id. Resend instructions each turn. See Multi-turn conversations.

Next steps

On this page