> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Orq.ai is the control plane for model and MCP traffic: one key reaches the workspace's enabled models, MCP servers, and resources. The setup depends on where the agent runs.
> Hosted assistant (ChatGPT, claude.ai, a hosted sandbox): install nothing. Tell the human to add https://my.orq.ai/v2/mcp as a remote MCP connector and finish the Orq.ai sign-in. With OAuth, send no Authorization header; otherwise send an API key as a bearer token.
> Local coding agent (Claude Code, Codex, Cursor, OpenCode): run `curl -fsSL https://cli.orq.ai/install.sh | sh`. It installs the CLI and runs `orq setup`, which signs in, writes a project-scoped key to `~/.orq/env`, and wires the detected agents through the AI Gateway. It can also add the Orq MCP server and Orq Skills, the workflows for agents, evaluations, and traces: https://docs.orq.ai/ai-studio/integrations/code-assistants/orq-skills.md. Verify with `orq status`.
> Headless or CI: read `ORQ_API_KEY` from the environment; a human creates the key at https://docs.orq.ai/ai-studio/organization/api-keys.md.
> Send model traffic to https://my.orq.ai/v3/router with `Authorization: Bearer $ORQ_API_KEY`; the Anthropic SDK uses https://my.orq.ai/v3/anthropic. New integrations go on `/v3/router`: `/v2/router` stays published for backward compatibility, and `orq.prompt` works only on `/v2/router/chat/completions`.
> Enable a model for the workspace and use its exact `provider/model` id. `POST /v2/workspace-models` enables a model, and a call fails while the workspace has neither credits nor a provider key.
> On `/chat/completions`, a reasoning model rejects `tools` with a `reasoning_effort` other than `none`; `/responses` keeps reasoning.
> On a failure, branch on `error.code` and follow `error.doc_url`; a budget rejection answers 429.

# Create a Live WebRTC session

> Exchange a WebRTC SDP offer for an answer and start a GPT-Live session. Requires an API key that grants `realtime.execute`.

> [!NOTE]
>
> **Related guide**: Realtime guide. See the [Realtime guide](https://docs.orq.ai/ai-gateway/features/realtime.md#gpt-live) for a walkthrough with examples.


## OpenAPI

````yaml post /v3/router/live/sessions
openapi: 3.1.0
info:
  title: orq.ai API
  version: '2.0'
  description: orq.ai API documentation
servers:
  - url: https://my.orq.ai
security:
  - ApiKey: []
tags:
  - name: Chunking
    description: Split text into smaller chunks for retrieval and generation workflows.
  - name: File Systems
    description: >-
      Create and manage persistent file systems that agents and MCP clients read
      from and write to.
  - name: Knowledge Bases
    description: Create and manage knowledge bases used by agents and retrieval workflows.
  - name: Memory Stores
    description: Create and manage memory stores, memories, and memory documents.
  - name: Evals
    description: Run an evaluator against a conversation and its result
  - description: >-
      API keys authenticate programmatic access to the workspace. They expose
      opaque tokens, per-domain access grants, and budget and rate-limit
      constraints.
    name: API keys
  - name: Logs
    description: >-
      OpenTelemetry log query API. Search, filter, aggregate, and facet log
      records ingested via OTLP.
  - name: Reporting
    description: >-
      GenAI reporting API over canonical analytics rollups. Accepts a metric
      name, time range, grain, group-by, and filters; returns a typed time
      series and optional totals.
  - name: Telemetry
    description: >-
      Unified query envelope for traces, metrics, and logs. One request shape,
      one filter dialect, and one response shape per source, validated by a
      per-source registry.
  - name: Telemetry Destinations
    description: >-
      OpenTelemetry destinations that receive a copy of the workspace's traces
      over OTLP/HTTP.
  - name: Traces
    description: >-
      Query and inspect ingested trace data: search trace summaries, aggregate
      metrics, and read individual traces and their spans.
  - name: Views
    description: Saved filters and columns for workspace observability pages.
  - name: Datasets
    description: >-
      Datasets store test cases and expected outputs used for evaluation and
      optimization workflows.
  - name: Experiments
    description: >-
      Create and run experiments: dataset rows against task columns, evaluators,
      and annotations.
  - description: List models available through the AI Router.
    name: Models
  - name: Agents
    description: External A2A agents registered for invocation through the ORQ AI Gateway.
  - name: Alerts
    description: >-
      Alerts evaluate a telemetry metric on a fixed interval and fire
      notifications through notifiers when the value breaches a threshold. Each
      breach opens a trigger that tracks the incident until the value recovers.
  - name: Annotation Queues
    description: Annotation queues collect spans for human review.
  - name: Audit Log Destinations
    description: >-
      Signed webhook destinations that receive workspace audit log events, for
      SIEM and compliance pipelines.
  - name: Budgets
    description: >-
      Budgets govern spend, token usage, and request rate across workspace,
      project, identity, API key, provider, model, factory, and category-default
      scopes. Category defaults provide a separate allowance for each entity; an
      active individual budget replaces its category default. Every applicable
      budget is enforced, and the most restrictive limit applies per dimension.
  - name: Environments
    description: Reusable workspace- and project-scoped deployment environments.
  - name: Files
    description: File upload and retrieval operations.
  - name: Guardrail Rules
    description: >-
      Guardrail Rules conditionally enforce evaluators and plugins for AI
      Gateway traffic. Rules may be scoped to a project or the whole workspace.
  - name: Hub
    description: Hub items are reusable templates available to a workspace.
  - name: Identities
    description: >-
      Identities represent end users from your system for usage and engagement
      tracking.
  - name: Management keys
    description: >-
      Management keys are workspace-scoped credentials that authenticate
      programmatic access to workspace administration surfaces (API keys,
      budgets). Unlike project-scoped API keys, a management key always operates
      at the workspace level.
  - name: MCP Gateway
    description: >-
      Register upstream MCP servers, discover and sync their tools, and assemble
      gateways that expose a curated tool surface to MCP clients.
  - name: Model Catalog
    description: >-
      Browse the orq.ai model catalog: every model orq offers, across every
      provider, with pricing, capabilities and benchmark data. List endpoints
      only return models that are not deprecated. This API is public, requires
      no authentication, and is rate limited to 120 requests per minute per IP.
      Responses carry a 5-minute cache-control max-age.
  - name: Model Fusions
    description: >-
      Model Fusions combine independent model answers through a panel, judge,
      and optional synthesizer.
  - name: Monitors
    description: >-
      Monitors are custom observability dashboards for traces, runtime metrics,
      and logs. Each monitor holds widgets that chart one telemetry query. List
      the metrics, operations, and dimensions available to your workspace with
      `GET /v3/telemetry/capabilities`, or start from a preset with `GET
      /v2/monitors/presets`.
  - name: Notifiers
    description: Notifier destinations used to send delivery and workflow notifications.
  - name: Projects
    description: Projects organize resources within a workspace
  - name: Routing Rules
    description: >-
      Routing Rules conditionally select models and enforce request plugins for
      AI Gateway traffic. Rules are evaluated by ascending priority and may be
      scoped to a project or the whole workspace.
  - name: Threads
    description: Threads group related trace invocations and their aggregate usage
  - name: Skills
    description: >-
      Skills are modular instructions you can use to codify processes and
      conventions
  - name: Smart Routers
    description: >-
      Create and manage workspace Smart Routers. A Smart Router selects a model
      from an eligible pool for each request according to a quality, balanced,
      or cost profile.
  - name: Users
    description: >-
      Workspace user administration. Requires a Management Key with user
      permissions or an authenticated workspace admin session. Standard API keys
      are not supported.
  - name: Webhooks
    description: >-
      Create and manage webhooks that deliver workspace events to external HTTPS
      endpoints.
  - name: Workspaces
    description: >-
      A workspace is the tenant. Create is called from a user session during
      onboarding; Get, List, and Update are the public management surface.
  - name: Workspace Security
    description: >-
      Workspace-level domain verification and IP allowlist controls. These
      operations are restricted to workspace administrators.
  - name: Workspace Settings
    description: >-
      Workspace-level settings managed with a workspace credential. A workspace
      is the tenant, so these settings are a singleton — there is nothing to
      create or delete, only read and update.
  - description: Search Gateway with managed credits or BYOK.
    name: Web Search
  - name: Live Sessions
  - name: Responses
  - description: Run agents on a cron cadence. Minimum firing interval is 1 hour.
    name: Agent Schedules
  - name: Embeddings
  - description: Beta. Run typed classification questions against a classify model.
    name: Classify
  - description: Beta. Run classification decisions with the classify contract.
    name: Decisions
  - description: >-
      Run large offline workloads as JSONL batches and download
      OpenAI-compatible result files.
    name: Batches
externalDocs:
  url: https://docs.orq.ai
  description: orq.ai Documentation
paths:
  /v3/router/live/sessions:
    post:
      tags:
        - Live Sessions
      summary: Create a Live WebRTC session
      description: >-
        Exchanges a WebRTC SDP offer for an answer and starts a GPT-Live
        session. Apply the returned answer to the peer connection and send Live
        events over the data channel. Requires an API key with
        `realtime.execute`.


        Voice usage is billed by the second at the active or standby rate. Set
        `wake_policy.type` to `speech` to start inference on speech. Set
        `idle_timeout_s` to return the session to standby after inactivity. Use
        client delegation to run backend work in your application.
      operationId: create-live-session
      requestBody:
        content:
          application/json:
            examples:
              standby:
                summary: Create a session that starts on speech and returns to standby
                value:
                  session:
                    idle_timeout_s: 15
                    model: openai/gpt-live-1.1
                    wake_policy:
                      type: speech
                  transport:
                    sdp: <SDP offer>
                    type: webrtc
            schema:
              properties:
                session:
                  additionalProperties: true
                  properties:
                    audio:
                      additionalProperties: true
                      description: OpenAI Live audio settings, including the output voice.
                      type: object
                    delegation:
                      additionalProperties: true
                      properties:
                        type:
                          description: Delegate work to the calling application.
                          enum:
                            - client
                          type: string
                      required:
                        - type
                      type: object
                    idle_timeout_s:
                      description: >-
                        Seconds of inactivity before inference returns to
                        standby when speech wake is enabled.
                      maximum: 60
                      minimum: 5
                      type: integer
                    instructions:
                      description: Instructions for the voice model.
                      type: string
                    model:
                      description: Gateway model ID, such as openai/gpt-live-1.1.
                      minLength: 1
                      type: string
                    wake_policy:
                      additionalProperties: false
                      properties:
                        type:
                          description: Wait for speech before starting inference.
                          enum:
                            - speech
                          type: string
                        vad_threshold:
                          description: Evidence of speech required to wake from standby.
                          maximum: 1
                          minimum: 0
                          type: number
                      required:
                        - type
                      type: object
                  required:
                    - model
                  type: object
                transport:
                  properties:
                    sdp:
                      description: SDP offer from the WebRTC peer connection.
                      minLength: 1
                      type: string
                    type:
                      enum:
                        - webrtc
                      type: string
                  required:
                    - type
                    - sdp
                  type: object
              required:
                - session
                - transport
              type: object
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  session:
                    additionalProperties: true
                    properties:
                      id:
                        description: Opaque ID assigned to this Live session.
                        type: string
                    required:
                      - id
                    type: object
                  transport:
                    $ref: '#/components/schemas/PublicLiveTransport'
                required:
                  - session
                  - transport
                type: object
          description: Returns the session ID and the WebRTC SDP answer.
        '400':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  error:
                    $ref: '#/components/schemas/APIError'
                required:
                  - error
          description: Invalid session configuration, SDP offer, transport, or model.
        '401':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  error:
                    $ref: '#/components/schemas/APIError'
                required:
                  - error
          description: Missing or invalid API key.
        '402':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  error:
                    $ref: '#/components/schemas/APIError'
                required:
                  - error
          description: Credits or a matching spending limit cannot cover the session.
        '403':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  error:
                    $ref: '#/components/schemas/APIError'
                required:
                  - error
          description: The API key lacks realtime.execute or cannot access the model.
        '404':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  error:
                    $ref: '#/components/schemas/APIError'
                required:
                  - error
          description: The requested model does not exist.
        '429':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  error:
                    $ref: '#/components/schemas/APIError'
                required:
                  - error
          description: A rate limit or budget was reached.
        '502':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  error:
                    $ref: '#/components/schemas/APIError'
                required:
                  - error
          description: >-
            OpenAI could not create the session or the gateway could not connect
            to its usage events.
        '503':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  error:
                    $ref: '#/components/schemas/APIError'
                required:
                  - error
          description: Realtime usage accounting is unavailable.
      x-code-samples:
        - label: Node.js
          lang: typescript
          source: |-
            import { readFile } from "node:fs/promises";
            import { Orq } from "@orq-ai/node";

            const orq = new Orq({ apiKey: process.env.ORQ_API_KEY });

            const result = await orq.live.createSession({
              session: {
                model: "openai/gpt-live-1.1",
                instructions: "Keep replies brief.",
                wakePolicy: { type: "speech" },
                idleTimeoutS: 15,
              },
              transport: {
                type: "webrtc",
                sdp: await readFile("offer.sdp", "utf8"),
              },
            });

            console.log(result.transport.sdp);
components:
  schemas:
    PublicLiveTransport:
      additionalProperties: false
      properties:
        sdp:
          description: SDP answer to apply as the remote description.
          type: string
        type:
          enum:
            - webrtc
          type: string
      required:
        - type
        - sdp
      type: object
    APIError:
      additionalProperties: false
      properties:
        code:
          type:
            - string
            - 'null'
        failures: {}
        message:
          type: string
        param:
          type:
            - string
            - 'null'
        type:
          type: string
      required:
        - message
        - type
        - param
        - code
      type: object
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.