> ## 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 an async run

> Start a background Developer API run.



## OpenAPI

````yaml /api-reference/developer-v1.openapi.yaml post /v1/runs
openapi: 3.1.0
info:
  title: CREAO Developer API
  version: 1.0.0
  description: |
    Create, update, and run personal CREAO agents from your backend 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: []
tags:
  - name: Agents
    description: Create, update, and edit personal agents for the authenticated account.
  - name: Runs
    description: Create, stream, fetch, and list Developer API runs.
paths:
  /v1/runs:
    post:
      tags:
        - Runs
      summary: Create an async run
      description: |
        Create a background run for an active personal CREAO agent. The request
        returns after the run is accepted. Poll the run by `run_id`, list recent
        runs, or provide a `webhook_url` to receive the terminal result.
      operationId: createAsyncRun
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAsyncRunRequest'
            examples:
              companyReport:
                summary: Company report
                value:
                  agent_id: 00000000-0000-4000-8000-000000000000
                  input:
                    company: Apple
                    year: '2025'
      responses:
        '202':
          description: Run accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Run'
              examples:
                pending:
                  value:
                    run_id: 11111111-1111-4111-8111-111111111111
                    status: pending
                    agent_id: 00000000-0000-4000-8000-000000000000
                    conversation_id: 22222222-2222-4222-8222-222222222222
        '400':
          $ref: '#/components/responses/AsyncInvalidInput'
        '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'
              examples:
                agentNotFound:
                  value:
                    error: AGENT_NOT_FOUND
                conversationNotFound:
                  value:
                    error: CONVERSATION_NOT_FOUND
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    CreateAsyncRunRequest:
      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.
        conversation_id:
          type: string
          format: uuid
          description: >-
            Existing conversation to continue. Omit to create a new
            conversation.
        webhook_url:
          type: string
          format: uri
          maxLength: 2048
          description: Public `http` or `https` URL for the terminal async result.
    Run:
      type: object
      required:
        - run_id
        - status
        - agent_id
        - conversation_id
      properties:
        run_id:
          type: string
          format: uuid
          description: Developer API run ID.
        status:
          $ref: '#/components/schemas/RunStatus'
        agent_id:
          type: string
          format: uuid
          description: Agent that ran.
        conversation_id:
          oneOf:
            - type: string
              format: uuid
            - type: 'null'
          description: Conversation ID for follow-up runs.
        result:
          $ref: '#/components/schemas/RunResult'
        usage:
          $ref: '#/components/schemas/Usage'
        error:
          $ref: '#/components/schemas/RunError'
        created_at:
          type: string
          format: date-time
        started_at:
          oneOf:
            - type: string
              format: date-time
            - type: 'null'
        completed_at:
          oneOf:
            - type: string
              format: date-time
            - type: 'null'
        webhook_delivered_at:
          oneOf:
            - type: string
              format: date-time
            - type: 'null'
    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.
    RunStatus:
      type: string
      enum:
        - pending
        - running
        - completed
        - failed
        - cancelled
    RunResult:
      type: object
      additionalProperties: true
      description: >-
        Final agent output. Completed runs commonly include `text` and may
        include `artifacts`.
      properties:
        text:
          type: string
        artifacts:
          type: array
          items:
            $ref: '#/components/schemas/Artifact'
    Usage:
      type: object
      required:
        - credits
      properties:
        credits:
          type: number
          description: Credits attributed to this Developer API run.
    RunError:
      type: object
      required:
        - code
      properties:
        code:
          type: string
          description: Stable machine-readable failure code.
    Artifact:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
        title:
          type: string
        type:
          type: string
        url:
          type: string
  responses:
    AsyncInvalidInput:
      description: >-
        Invalid async run request shape, invalid UUID, unsupported field, or
        oversized input.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            invalidInput:
              value:
                error: INVALID_INPUT
    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.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            accountBlocked:
              value:
                error: ACCOUNT_BLOCKED
    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

````