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

# Create a realtime run

> Start a CREAO CLI run and stream public events.



## OpenAPI

````yaml /developer-api/developer-v1.openapi.yaml post /v1/realtime/runs
openapi: 3.1.0
info:
  title: CREAO CLI
  version: 1.0.0
  description: |
    Create, update, and run personal CREAO agents from your backend through
    CREAO CLI with Account API keys. The `/v1` API uses stable `agent_id`,
    `conversation_id`, and `run_id` identifiers and is served from
    `developer.creao.ai`.
servers:
  - url: https://developer.creao.ai
    description: Production
security:
  - bearerAuth: []
  - apiKeyQuery: []
tags:
  - name: Agents
    description: >-
      Create, list, get, update, and edit personal agents for the authenticated
      account.
  - name: Agent Memory
    description: >-
      Read, overwrite, and clear long-term memory (playbooks) for a personal
      agent.
  - name: Agent Files
    description: List, download, and delete files in a personal agent's skill file space.
  - name: Product Profile
    description: Once-per-account Super Agent persona and brand context.
  - name: Agent Runs
    description: >-
      Create, stream, fetch, and list runs for created personal agents. Super
      Agent rows are excluded. `usage.models` is present only for Super
      Agent–allowlisted accounts.
  - name: Super Agent
    description: >-
      Chat with CREAO Super Agent from your backend. Same public NDJSON render
      protocol as Agent Runs. Requires an allowlisted account. `usage.models` is
      present only for Super Agent–allowlisted accounts.
  - name: Account
    description: Read the calling account's platform-wallet balance and CREAO CLI spend.
  - name: Workspaces
    description: Create and list personal workspaces, and add or remove personal agents.
  - name: Workspace Files
    description: Upload, list, download, and delete files in a personal workspace.
  - name: Secrets
    description: Add, update, and list account secret keys. Values are write-only.
  - name: Skills
    description: Install, list, and enable account-level Agent Brain skills.
  - name: Rooms
    description: >-
      Read team rooms, post messages as the key's owner, and stream room events.
      The key acts as its owner.
paths:
  /v1/realtime/runs:
    post:
      tags:
        - Agent Runs
      summary: Create a realtime run
      description: |
        Create a realtime Agent Run and receive a public NDJSON render stream
        (`application/x-ndjson`). Use this endpoint when your product experience
        needs live assistant output, thinking, search and todo cards, opaque
        tool progress, artifacts, and a terminal event. Optional `workspace_id`
        binds the conversation to a personal workspace so the agent can read
        workspace-root uploads. Super Agent streaming uses
        `POST /v1/super-agent/realtime/runs` — do not send `mode: "chat"` here.
      operationId: createRealtimeRun
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRealtimeRunRequest'
            examples:
              realtimeSummary:
                summary: Realtime summary
                value:
                  agent_id: 00000000-0000-4000-8000-000000000000
                  input:
                    query: Summarize the latest quarterly report.
                  model: anthropic/claude-haiku-4-5
      responses:
        '200':
          description: Public NDJSON render stream. One JSON object per line.
          headers:
            Cache-Control:
              schema:
                type: string
              description: Always `no-cache`.
            X-Accel-Buffering:
              schema:
                type: string
              description: Always `no`.
          content:
            application/x-ndjson:
              schema:
                $ref: '#/components/schemas/PublicRenderEvent'
              examples:
                stream:
                  value: >
                    {"type":"run.created","run_id":"11111111-1111-4111-8111-111111111111","agent_id":"00000000-0000-4000-8000-000000000000","conversation_id":"22222222-2222-4222-8222-222222222222","model":"anthropic/claude-haiku-4-5","render_protocol":1}

                    {"type":"thinking.started"}

                    {"type":"thinking.delta","delta":"Find the latest quarter"}

                    {"type":"thinking.completed"}

                    {"type":"output_text.delta","delta":"Hello"}

                    {"type":"run.completed","run_id":"11111111-1111-4111-8111-111111111111","status":"completed","result":{"text":"Hello","blocks":[{"type":"thinking"},{"type":"text","content":"Hello"}]}}
        '400':
          $ref: '#/components/responses/RealtimeInvalidInput'
        '401':
          $ref: '#/components/responses/AuthenticationRequired'
        '402':
          $ref: '#/components/responses/InsufficientCredits'
        '403':
          $ref: '#/components/responses/AccountBlocked'
        '404':
          description: The agent or conversation does not exist for this account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: The conversation is already bound to a different workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                workspaceMismatch:
                  value:
                    error: WORKSPACE_MISMATCH
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    CreateRealtimeRunRequest:
      type: object
      additionalProperties: false
      required:
        - agent_id
        - input
      properties:
        agent_id:
          type: string
          format: uuid
          description: Active personal CREAO agent to run.
        input:
          description: >-
            JSON input for the agent. Serialized input must be 256 KB or
            smaller.
        model:
          type: string
          maxLength: 100
          description: >-
            Model id to run with (for example, `anthropic/claude-haiku-4-5`).
            Omit to use the agent's default model and thinking level (see
            `default_model_id` on the agent), or `anthropic/claude-sonnet-5-5`
            when the agent has none. Supported ids:
            https://agent.docs.creao.ai/developer-api/supported-models. Unknown
            ids return 400 `MODEL_NOT_SUPPORTED`; models not available on your
            plan return 403 `MODEL_NOT_ALLOWED`.
        conversation_id:
          type: string
          format: uuid
          description: >-
            Existing conversation to continue. Omit to create a new
            conversation.
        workspace_id:
          type: string
          format: uuid
          description: >-
            Personal workspace whose root uploads the agent can read. On a new
            conversation this value is stored. On an existing conversation it
            must match the bound workspace or the conversation must be unbound.
            Mismatch returns 409 `WORKSPACE_MISMATCH`.
    PublicRenderEvent:
      oneOf:
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              const: run.created
            run_id:
              type: string
              format: uuid
            agent_id:
              oneOf:
                - type: string
                  format: uuid
                - type: 'null'
            conversation_id:
              type: string
              format: uuid
            model:
              oneOf:
                - type: string
                - type: 'null'
            render_protocol:
              type: integer
              const: 1
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              const: message.created
            role:
              type: string
              const: assistant
            message_id:
              type: string
        - type: object
          required:
            - type
            - delta
          properties:
            type:
              type: string
              const: output_text.delta
            delta:
              type: string
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - thinking.started
                - thinking.completed
        - type: object
          required:
            - type
            - delta
          properties:
            type:
              type: string
              const: thinking.delta
            delta:
              type: string
        - type: object
          required:
            - type
            - tool_call_id
            - tool
            - title
          properties:
            type:
              type: string
              const: tool.started
            tool_call_id:
              type: string
            tool:
              type: string
            title:
              type: string
        - type: object
          required:
            - type
            - tool_call_id
            - tool
            - status
          properties:
            type:
              type: string
              const: tool.completed
            tool_call_id:
              type: string
            tool:
              type: string
            status:
              type: string
              enum:
                - completed
                - failed
        - type: object
          required:
            - type
            - search_id
            - kind
            - query
          properties:
            type:
              type: string
              const: search.started
            search_id:
              type: string
            kind:
              type: string
              enum:
                - web
                - academic
            query:
              type: string
        - type: object
          required:
            - type
            - search_id
            - kind
            - query
            - results
          properties:
            type:
              type: string
              const: search.completed
            search_id:
              type: string
            kind:
              type: string
              enum:
                - web
                - academic
            query:
              type: string
            results:
              type: array
              items:
                $ref: '#/components/schemas/PublicSearchResult'
        - type: object
          required:
            - type
            - items
          properties:
            type:
              type: string
              const: todo.updated
            items:
              type: array
              items:
                $ref: '#/components/schemas/PublicTodoItem'
        - type: object
          required:
            - type
            - artifact_id
            - kind
            - title
          properties:
            type:
              type: string
              const: artifact.created
            artifact_id:
              type: string
            kind:
              type: string
              enum:
                - file
                - image
            title:
              type: string
            mime_type:
              type: string
        - type: object
          required:
            - type
            - run_id
            - status
          properties:
            type:
              type: string
              const: run.completed
            run_id:
              type: string
              format: uuid
            status:
              type: string
              const: completed
            usage:
              $ref: '#/components/schemas/Usage'
            result:
              $ref: '#/components/schemas/RunResult'
        - type: object
          required:
            - type
            - run_id
            - status
            - error
          properties:
            type:
              type: string
              const: run.failed
            run_id:
              type: string
              format: uuid
            status:
              type: string
              const: failed
            error:
              $ref: '#/components/schemas/RunError'
            usage:
              $ref: '#/components/schemas/Usage'
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              const: error
            code:
              type: string
        - type: object
          required:
            - type
            - timestamp
          properties:
            type:
              type: string
              const: ping
            timestamp:
              type: string
              format: date-time
    ErrorResponse:
      type: object
      additionalProperties: true
      required:
        - error
      properties:
        error:
          type: string
          description: Stable machine-readable error code.
        message:
          type: string
          description: Debug message. Do not rely on this field in production clients.
        available:
          type: number
          description: Available credits, when returned for credit errors.
        required:
          type: number
          description: Required credits, when returned for credit errors.
        retryAfterSeconds:
          type: integer
          description: Retry delay, when returned for hourly cap errors.
        reason:
          type: string
          description: >-
            A readable explanation on `400` and `409` room and agent bundle
            errors. Do not branch on it.
        latest_version:
          type: string
          description: The agent's latest saved version, on `AGENT_VERSION_NOT_INCREASED`.
        candidates:
          type: array
          description: >-
            Members a `ROOM_MENTION_AMBIGUOUS` name matches. Resend with one of
            their ids in `mentions` to pick it.
          items:
            type: object
            properties:
              member_id:
                type: string
                format: uuid
              kind:
                type: string
                enum:
                  - user
                  - agent
              name:
                oneOf:
                  - type: string
                  - type: 'null'
    PublicSearchResult:
      type: object
      required:
        - url
        - title
        - domain
      properties:
        url:
          type: string
        title:
          type: string
        domain:
          type: string
        authors:
          type: array
          items:
            type: string
        venue:
          type: string
        year:
          type: integer
        cited_by_count:
          type: integer
        pdf_url:
          type: string
    PublicTodoItem:
      type: object
      required:
        - content
        - status
      properties:
        content:
          type: string
        status:
          type: string
          enum:
            - pending
            - in_progress
            - completed
            - skipped
            - cancelled
    Usage:
      type: object
      description: |
        Settlement credits plus an optional per-model breakdown for the run.
        Omitted when the run incurred no cost and collected no model usage.
        `models` is present only for Super Agent–allowlisted accounts.
        Token fields appear only for token-metered capabilities. Per-image
        and per-second capabilities use `generated_images` or `duration_seconds`
        instead. `kind` tells the client which fields apply.
      properties:
        credits:
          type: number
          description: >-
            Credits attributed to this CREAO CLI run. Settlement figure when
            cost is greater than zero.
        models:
          type: array
          description: >
            One row per `(model, kind)` aggregated for the run. Top-level
            `model`

            remains the requested chat model. Non-model bridge spend such as

            PDF parse is excluded.
          items:
            $ref: '#/components/schemas/UsageModel'
    RunResult:
      type: object
      additionalProperties: true
      description: >-
        Final agent output. Completed runs commonly include `text`;
        agent-creation runs also include `agent_id`.
      properties:
        agent_id:
          type: string
          format: uuid
          description: New agent ID when a `POST /v1/agents` creation run completes.
        agent_name:
          type: string
        text:
          type: string
          description: >-
            Terminal result text. When the agent recorded a session summary,
            this is that summary JSON. Otherwise it is the full assistant
            transcript. Use `raw_output=true` on GET to prefer `chat_text`.
        chat_text:
          type: string
          description: >-
            Full assistant transcript when it differs from `text`. Present on
            newly completed runs that also stored a session summary. Historical
            runs may omit this field.
        blocks:
          type: array
          description: >-
            Compact public render snapshot for the same vocabulary as the
            realtime stream. Multiple thinking blocks follow stream order. GET
            may include thinking `content`; list and webhooks stay marker-only.
            Artifact `url` is added only on GET hydrate.
          items:
            $ref: '#/components/schemas/PublicRenderBlock'
        artifacts:
          type: array
          items:
            $ref: '#/components/schemas/Artifact'
    RunError:
      type: object
      required:
        - code
      properties:
        code:
          type: string
          description: Stable machine-readable failure code.
    UsageModel:
      type: object
      required:
        - model
        - kind
      properties:
        model:
          type: string
          maxLength: 100
          description: Model id that produced this usage row.
        kind:
          type: string
          enum:
            - chat
            - image_analysis
            - image_generation
            - video_generation
            - speech_to_text
            - text_to_speech
            - music_generation
        input_tokens:
          type: integer
          minimum: 0
        output_tokens:
          type: integer
          minimum: 0
        cache_read_tokens:
          type: integer
          minimum: 0
        cache_write_tokens:
          type: integer
          minimum: 0
        generated_images:
          type: integer
          minimum: 0
          description: Present for per-image billing (for example GPT Image or Seedream).
        duration_seconds:
          type: number
          minimum: 0
          description: Present for per-second video billing (for example Veo).
    PublicRenderBlock:
      oneOf:
        - type: object
          required:
            - type
            - content
          properties:
            type:
              type: string
              const: text
            content:
              type: string
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              const: thinking
            content:
              type: string
              description: >-
                Thinking text for this span. Present on a completed-run GET
                after hydrate. Omitted from the persisted snapshot, list, and
                webhooks.
        - type: object
          required:
            - type
            - tool_call_id
            - tool
            - title
            - status
          properties:
            type:
              type: string
              const: tool
            tool_call_id:
              type: string
            tool:
              type: string
            title:
              type: string
            status:
              type: string
              enum:
                - running
                - completed
                - failed
        - type: object
          required:
            - type
            - search_id
            - kind
            - query
            - results
          properties:
            type:
              type: string
              const: search
            search_id:
              type: string
            kind:
              type: string
              enum:
                - web
                - academic
            query:
              type: string
            results:
              type: array
              items:
                $ref: '#/components/schemas/PublicSearchResult'
        - type: object
          required:
            - type
            - items
          properties:
            type:
              type: string
              const: todo
            items:
              type: array
              items:
                $ref: '#/components/schemas/PublicTodoItem'
        - type: object
          required:
            - type
            - artifact_id
            - kind
            - title
          properties:
            type:
              type: string
              const: artifact
            artifact_id:
              type: string
            kind:
              type: string
              enum:
                - file
                - image
            title:
              type: string
            mime_type:
              type: string
            url:
              oneOf:
                - type: string
                  format: uri
                - type: 'null'
            url_expires_at:
              type: string
              format: date-time
    Artifact:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
        title:
          type: string
        type:
          type: string
        url:
          oneOf:
            - type: string
              format: uri
            - type: 'null'
          description: >-
            Short-lived download URL issued when fetching a run. `null` when the
            artifact has no durable file or the key cannot be signed.
        url_expires_at:
          type: string
          format: date-time
          description: Expiry of `url`. Omitted when `url` is null.
  responses:
    RealtimeInvalidInput:
      description: >-
        Invalid realtime run request shape, invalid UUID, unsupported field,
        unsupported model, or oversized input.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            invalidInput:
              value:
                error: INVALID_INPUT
            modelNotSupported:
              value:
                error: MODEL_NOT_SUPPORTED
            inputTooLarge:
              value:
                error: INPUT_TOO_LARGE
    AuthenticationRequired:
      description: Missing, malformed, revoked, or unknown Account API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingKey:
              value:
                error: AUTHENTICATION_REQUIRED
    InsufficientCredits:
      description: Account does not have enough credits to start the run.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficientCredits:
              value:
                error: INSUFFICIENT_CREDITS
                available: 0
                required: 1000
    AccountBlocked:
      description: >-
        Account is blocked from starting new runs, or the selected model is
        blocked by plan or entitlement access.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            accountBlocked:
              value:
                error: ACCOUNT_BLOCKED
            modelNotAllowed:
              value:
                error: MODEL_NOT_ALLOWED
    RateLimited:
      description: Account-level or IP-level rate limit exceeded.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimited:
              value:
                error: RATE_LIMITED
    ServiceUnavailable:
      description: Agent execution service was unavailable before the run was accepted.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            unavailable:
              value:
                error: SERVICE_UNAVAILABLE
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: cr_sk
      description: Account API key from Developer Console. Keys start with `cr_sk_`.
      x-default: cr_sk_your_key_here
    apiKeyQuery:
      type: apiKey
      in: query
      name: creao-api-key
      description: |
        Account API key passed as a query parameter, for platforms that cannot
        set a custom Authorization header. The bearerAuth header takes
        precedence when both are present.
      x-default: cr_sk_your_key_here

````

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