Orq MCP is live: Use natural language to interrogate traces, spot regressions, and experiment your way to optimal AI configurations. Available in Claude Desktop, Claude Code, Cursor, and more. Start now →
Create model responses with the OpenResponses-compatible endpoint — tool calling, multi-turn conversations, streaming, and agent invocation.
The Responses API (/v3/router/responses) is orq.ai’s primary endpoint for interacting with LLMs. It implements the OpenResponses specification — an open, multi-provider, interoperable interface for language models — and extends it with orq.ai platform features.
The Responses API replaces the traditional chat completions pattern with a stateful, item-based model:
Stateful by default — responses are stored and can be continued with previous_response_id, eliminating the need to resend the full conversation history.
Semantic streaming — events like response.output_text.delta and response.function_call_arguments.delta instead of raw token chunks.
Native tool calling — built-in agentic loop where the model calls tools, receives results, and continues automatically.
Multi-provider — same API for OpenAI, Anthropic, Google, AWS Bedrock, Azure, Groq, and more.
Invoke a pre-configured agent from the orq.ai platform
When using agent/<key>, the agent’s instructions, tools, model, and settings are applied automatically. You can still override parameters like input, variables, and identity per request.Create agents in the Agent Studio or via the Agents API.
curl -X POST https://api.orq.ai/v3/router/responses \ -H "Authorization: Bearer $ORQ_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "agent/customer_support", "input": "I need help with my order #12345", "variables": { "customer_tier": "premium" } }'
Define custom functions the model can call. When the model decides to use a tool, the response status is requires_action with a function_call output item. Provide the result in a follow-up request. See the Function Tool Continuation guide for a complete walkthrough.
curl -X POST https://api.orq.ai/v3/router/responses \ -H "Authorization: Bearer $ORQ_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "openai/gpt-4o", "input": "What is the weather in Paris?", "tools": [{ "type": "function", "name": "get_weather", "description": "Get current weather for a location", "parameters": { "type": "object", "properties": { "location": { "type": "string" } }, "required": ["location"] } }] }'
Use variables to substitute {{placeholder}} values in instructions or agent prompts.For sensitive data (API keys, tokens), wrap the value in a secret object — {"secret": true, "value": "..."}. Secrets don’t need to be referenced in the input or instructions — they are automatically passed to platform tools (Python code, HTTP, MCP) when executed. The secret value is:
Passed to platform tools — Python code tools, HTTP tools, and MCP tools receive the decrypted value at execution time
Stripped from the response — secret variable keys do not appear in response.variables
Redacted in OTEL traces — replaced with *** in all trace spans
Not persisted across continuations — you must re-send secrets with each request
{ "input": "Fetch the latest data from the API", "variables": { "name": "Alice", "api_token": { "secret": true, "value": "sk-secret-123" } }}
When an agent uses Python code tools, HTTP tools, or MCP tools, secret variables are available automatically:
Python tools: Variables are merged into the tool’s params and injected as local Python variables. A tool with result = f"Token: {api_token}" receives the decrypted value as the api_token variable at runtime. The tool output is returned to the model as-is, but the secret is redacted in traces.
HTTP tools: {{api_token}} in URLs, headers, or request bodies is replaced with the real value before the HTTP call is made.
Subagents: Secret variables propagate to subagents in multi-agent systems via the variables context — each subagent receives the same variables (including secrets) and can use them in its own tools. Secrets are redacted from all traces across the entire execution chain.