Skip to documentation
deepthroat
DocsAPI reference
DEEPTHROAT DEVELOPER GUIDE

Responses API

Use Responses-compatible SDKs and Codex with streaming and client-executed tools.

On this pageCreate a responseStreaming eventsTool round tripsImages & visionConversation storageSupported features

Create a response

POST/v1/responses

Use the same key and exact text-model IDs as Chat Completions. Send input as a string or an array of conversation items, and use instructions for the current turn’s system instructions.

python
from openai import OpenAI

client = OpenAI(base_url="https://api.cheapai.gay/v1", api_key="YOUR_API_KEY")
response = client.responses.create(
    model="gpt-6.1-sol",
    input="Say hello.",
    store=False,
)
print(response.output_text)

The response contains an output array of message, reasoning, or tool-call items, plus input/output token usage. Reasoning effort uses reasoning: {"effort": "low"}. Image requests use reported upstream token counts when available; otherwise usage is estimated.

Streaming events

Set stream: true to receive named server-sent events with increasing sequence numbers.

python
with client.responses.stream(
    model="gpt-6.1-sol", input="Say hello.", store=False
) as stream:
    for event in stream:
        if event.type == "response.output_text.delta":
            print(event.delta, end="", flush=True)
    response = stream.get_final_response()
EventPurpose
response.created / in_progressStart of the response
response.output_item.added / doneLifecycle of each output item
response.output_text.delta / doneIncremental text and its completed value
response.function_call_arguments.delta / doneFunction argument JSON
response.custom_tool_call_input.delta / doneExact raw input for custom tools
response.reasoning_summary_text.delta / doneReasoning text when supplied by the model
response.completedSuccessful final output and usage
response.failed / errorGeneration failed; do not treat it as completed

Responses streaming finishes with response.completed. Check this event before executing a completed turn’s tools.

Tool round trips

Responses function definitions place name, description, and parameters directly on each tool. Your application executes tools; the API returns their requested arguments.

python
history = [{"role": "user", "content": "What time is it in Auckland?"}]
tools = [{
    "type": "function", "name": "gettime",
    "parameters": {
        "type": "object",
        "properties": {"city": {"type": "string"}},
        "required": ["city"],
        "additionalProperties": False,
    },
}]
response = client.responses.create(
    model="gpt-6.1-sol", input=history, tools=tools, store=False
)
history.extend(response.output)
for item in response.output:
    if item.type == "function_call":
        history.append({
            "type": "function_call_output",
            "call_id": item.call_id,
            "output": '{"time":"14:30"}',
        })
response = client.responses.create(
    model="gpt-6.1-sol", input=history, tools=tools, store=False
)

Preserve every call ID and return one matching result for every call. Custom text tools use custom_tool_call and custom_tool_call_output; their input preserves raw text and line breaks. Namespaced tool definitions are also accepted. Custom grammar is passed as guidance; your harness validates it before execution.

Images & vision

Choose a model with vision: true from /v1/models using your own key. Currently verified: Claude Opus 5, Gemini 3.8 Flash, DeepSeek V4.1 Flash, and GPT-6.1 Sol on the normal route.

python
response = client.responses.create(
    model="claude-opus-5",
    input=[{"role": "user", "content": [
        {"type": "input_text", "text": "Describe this image."},
        {"type": "input_image", "image_url": "data:image/png;base64,BASE64_IMAGE"},
    ]}],
    store=False,
)
print(response.output_text)

Chat Completions accepts image_url blocks with {"url": "data:image/png;base64,..."}. Messages accepts image blocks with source.type set to base64 and matching media_type and data, or url with a public HTTPS URL. Responses accepts input_image. Public HTTPS URLs are downloaded and validated before generation.

Image limits
PNG, JPEG, WebP, or still GIF; up to 8 images, 5 MiB each and 10 MiB combined per request, including replayed history. Maximum 8,000 pixels per side and 20 megapixels. Private URLs, animated images, file IDs, and invalid image data are rejected. Use smaller images or store: false when resolved input exceeds the 4 MiB storage limit.

Use the Playground attachment button to upload images. Integration downloads advertise image support only for verified Vision models; refresh the configuration after changing nodes.

Conversation storage

For stateless requests, use store: false and replay the full input and output history. Codex uses this mode.

With store: true (the default), a completed response can be fetched or deleted with GET or DELETE /v1/responses/{id}. Continue with previous_response_id and new input using the same key and model. Supply any instructions needed for the new turn again.

Storage limits
Stored responses expire after 24 hours and can be removed earlier by retention limits: 128 per key, 4,096 overall, or 64 MiB of stored response data. Stored input is limited to 4 MiB; stateless input supports up to 16 MiB. Keep your own history for long-running projects.

Supported features

FeatureSupport
Text input and outputSupported
HTTP streaming and reasoning effortSupported
Function, custom text, and namespaced toolsSupported; executed by your client
Previous response IDs, retrieval, deletionSupported for stored responses owned by your key
Web searchSupported; see the Web search guide
Hosted file search and computer useNot supported
Image inputSupported for models with vision: true on your selected node
Audio, structured output, encrypted reasoningNot supported on this endpoint
Background jobs, WebSockets, remote compactionNot supported
max_output_tokensNot supported; omit this parameter

Use the Codex setup guide to configure its supported HTTP transport.