Skip to main content
As part of Release 4.7, we rewrote the AI Router and Agents runtime in Golang for improved performance, lower latency, and reduced memory consumption. Both are in beta for April and moving to GA in May. This page covers the new endpoints and how to use them.

AI Router V3

The V3 router exposes the same chat completions endpoint you already use, now at /v3/router/chat/completions. It supports all existing functionality (chat completions, embeddings, image generation, transcription, translation) with the addition of extended parameters like identity and thread. The router stays fully compatible with the OpenAI SDK.

Chat Completions

cURL
curl --location 'https://api.orq.ai/v3/router/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $ORQ_API_KEY' \
--data-raw '{
    "model": "openai/gpt-4o-mini",
    "messages": [
        {
            "role": "system",
            "content": "You are a helpful assistant."
        },
        {
            "role": "user",
            "content": "What can you help me with today?"
        }
    ],
    "identity": {
        "id": "user-123",
        "display_name": "Jane Doe",
        "email": "jane.doe@example.com"
    },
    "thread": {
        "id": "thread-001",
        "tags": ["support", "v3"]
    },
    "stream": false
}'

Key Parameters

ParameterDescription
modelProvider and model in provider/model format (e.g., openai/gpt-4o-mini)
messagesStandard chat completion messages array
identityAssociate the request with a user identity for tracking and analytics
threadGroup requests into a conversation thread with optional tags
streamSet to true for streaming responses
V3 supports all the same extended parameters as the V2 router, including fallback configurations, retry logic, and all other orq-specific parameters you are already using.

Responses V1

The /v1/responses endpoint follows the OpenResponses specification. It provides a stateful, interaction-based way to work with models and agents. You can use it in two ways:
  1. With a model and tools - invoke any model directly with tools, variables, and extended parameters.
  2. With an agent - invoke an agent you created via the Agents API or Agent Studio.

Invoking a Model with Tools

Use the model field with a provider/model format to invoke a model directly. You can attach tools, variables, identity, and thread parameters.
cURL
curl --location 'https://api.orq.ai/v1/responses' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $ORQ_API_KEY' \
--data-raw '{
    "model": "openai/gpt-4o",
    "input": "What is the current CET time? Answer in {{language}}",
    "tools": [
        {
            "type": "orq:current_date"
        }
    ],
    "variables": {
        "language": {
            "value": "hungarian"
        }
    },
    "identity": {
        "id": "user-123",
        "display_name": "Jane Doe",
        "email": "jane.doe@example.com"
    },
    "thread": {
        "id": "thread-001",
        "tags": ["support", "v3"]
    },
    "stream": false
}'

Invoking an Agent

To invoke an agent, set the model field to agent/your_agent_name. The agent must first be created via the Agents API or the Agent Studio.
cURL
curl --location 'https://api.orq.ai/v1/responses' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $ORQ_API_KEY' \
--data-raw '{
    "model": "agent/support_agent",
    "input": "What is the current CET time? Answer in {{language}}",
    "tools": [
        {
            "type": "orq:current_date"
        }
    ],
    "variables": {
        "language": {
            "value": "hungarian"
        }
    },
    "identity": {
        "id": "user-123",
        "display_name": "Jane Doe",
        "email": "jane.doe@example.com"
    },
    "thread": {
        "id": "thread-001",
        "tags": ["support", "v3"]
    },
    "stream": false
}'

Key Parameters

ParameterDescription
modelEither provider/model for direct model invocation or agent/agent_name for agent invocation
inputThe user input. Supports {{variable}} template syntax
toolsArray of tools the model or agent can use (e.g., orq:current_date)
variablesKey-value pairs for template variables. Each variable has a value and an optional secret flag (set to true for sensitive values like API keys to mark them as encrypted)
identityAssociate the request with a user identity
threadGroup requests into a conversation thread with optional tags
streamSet to true for streaming responses