LaminarityDocs
View agent text
Integration guide

Responses API (beta)

Use Laminarity's stateless OpenAI Responses-compatible subset for response, tool and coding-agent flows, including OpenAI Codex CLI.

Read this guide as Markdown

Create a response

The beta Responses endpoint is a stateless translation layer over Laminarity's Chat Completions orchestration. It accepts a string or compatible item list as input. instructions becomes the developer message, and model: "auto" retains Laminarity selection and fallback.

bash
curl https://api.laminarity.ai/v1/responses \
  -H "Authorization: Bearer $LAMINARITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "instructions": "Answer concisely.",
    "input": "Give me one launch checklist item."
  }'

Use the OpenAI SDK

python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["LAMINARITY_API_KEY"],
    base_url="https://api.laminarity.ai/v1",
)

response = client.responses.create(
    model="auto",
    instructions="Answer concisely.",
    input="Give me one launch checklist item.",
)
print(response.output_text)

Stream typed events

Set stream: true to receive Responses-style server-sent events. Text streams emit response.created, one or more response.output_text.delta events, and response.completed. Tool arguments use response.function_call_arguments.delta; failures use an error event.

Replay tool results

Function tools are supported. Send the returned function_call item and a matching function_call_output item in the next request's input list.

previous_response_id is not supported because Laminarity does not persist response state; store is accepted for compatibility but does not add persistence. Replay prior output items explicitly instead, including returned reasoning items exactly as received. Their encrypted_content carries a signed binding to the model and project, so replay them only to the same model.

Supported request shape

input items may be messages (including an assistant phase), function_call and function_call_output, reasoning replay, and, on native Responses models, custom_tool_call, custom_tool_call_output, client tool-search history and one leading developer additional_tools item.

tools may contain function tools on any model. custom tools, namespace groups of function and custom tools, and client-executed tool_search require a native Responses model; GET /v1/models marks these with responses_custom_tools and responses_client_tool_search.

Hosted web_search and web_search_preview tools are removed before execution and listed in the X-Laminarity-Dropped-Tools response header; requiring one through tool_choice is rejected. Other hosted tools, such as file_search, code_interpreter and mcp, are rejected with an error that names the tool type.

Unknown top-level fields are ignored and never forwarded, so a successful request does not prove an unsupported feature was executed. prompt_cache_key is used for cache affinity and forwarded when supported; client_metadata is accepted and discarded. max_tokens and max_completion_tokens are treated as max_output_tokens (an explicit max_output_tokens wins), and stop is accepted. Other Chat Completions parameters with no Responses equivalent, such as frequency_penalty, presence_penalty and response_format, are rejected by name rather than silently ignored. When the serving model cannot honour an optional setting, such as stop, a strict tool flag, parallel_tool_calls or an unsupported reasoning effort, Laminarity removes it or uses the nearest supported effort and lists the change in the X-Laminarity-Adjusted response header.

The streaming lifecycle is intentionally smaller than the full OpenAI API.

Use OpenAI Codex CLI

Codex CLI talks to custom providers only through the Responses API. Add a Laminarity provider to ~/.codex/config.toml and export LAMINARITY_API_KEY. Codex declares custom and namespaced tools, so pin a native Responses model such as gpt-6.1-sol or gpt-6-sol, or use auto, which then routes only among native Responses models.

With auto, leave model_reasoning_effort unset: Laminarity's automatic routing uses each candidate's reviewed effort and rejects a conflicting caller effort. Codex's hosted web search is removed by Laminarity, so the model works without it; set web_search = "disabled" to stop Codex from offering it.

toml
model_provider = "laminarity"
model = "gpt-6.1-sol"
web_search = "disabled"

[model_providers.laminarity]
name = "Laminarity"
base_url = "https://api.laminarity.ai/v1"
env_key = "LAMINARITY_API_KEY"
wire_api = "responses"

Upstream documentation

Docs build local