Skip to content
Navigation

Start a run

Start a run of the agent. Answers 202 with the run object, or streams events with Accept: text/event-stream. A nested agent path such as support/intake goes in the URL as is. An agent of the root repo answers at /{agent}.

POST
https://{org}.cloudraker.run/{base}/{agent}
Try it
Path parameters
Header parameters
Request body
Live API request

This request can change data or incur charges for the selected organization.

Authorization

  • bearer
    HTTP
    required

Path parameters

  • base
    string
    required

    The base path of the repo: its name by default (D41). The root repo of the org has none: use /{agent}.

  • agent
    string
    required

Header parameters

  • Idempotency-Key
    optional
    string

    Kept 24 h per org.

    maxLength: 255 · minLength: 1
  • Accept
    optional
    application/json
    or
    text/event-stream

    text/event-stream streams the run.

Request body JSON required

  • input
    unknown
    required

    Text or JSON. Max 1 MB. Validated against input_schema when the agent sets it.

  • files
    optional
    array of
    FileInput

    One of the following:

    • By URL
      • url
        string
        required

        HTTPS only. Max 25 MB.

        format: uri
      • name
        optional
        string
      • content_type
        optional
        string
    • Inline
      • content_base64
        string
        required

        Max 5 MB decoded.

      • name
        string
        required
      • content_type
        string
        required
    • By file id
      • file_id
        string
        required

        An existing tenant file, for example a file artifact of another run.

  • secrets
    optional
    map of
    string

    Override values for secrets marked overridable: true. They live for this turn only. Min 8 bytes per value. A public agent refuses this field.

  • model
    optional
    object

    Only when the agent sets model.allow_override: true.

    • id
      string
      required
  • metadata
    optional
    map of
    string

    Max 20 keys, string values, 1 KB in total. Echoed on every event and webhook. end_user scopes data store records.

Returns

202

The run object, or the event stream.

JSON
  • id
    string
    required
  • agent
    string
    required
  • mode
    zeroshot
    or
    turns
    or
    machine
    required
  • status
    queued
    or
    running
    or
    waiting
    or
    completed
    or
    failed
    or
    cancelled
    +1 more
    required
  • turn
    integer
    required
  • deployment
    object
    required
    • sha
      optional
      string
    • deployed_at
      optional
      string
      format: date-time
  • created_at
    string
    required
    format: date-time
  • updated_at
    string
    required
    format: date-time
  • last_seq
    integer
    required
  • metadata
    map of
    string
    required

    Max 20 keys, string values, 1 KB in total. Echoed on every event and webhook. end_user scopes data store records.

  • stream_url
    string
    required
    format: uri
  • expires_at
    optional
    string | null

    Set while a turns or machine run is waiting.

    format: date-time
  • read_token
    optional
    string

    rrt_ token. Reads this run only. Present on the start answer.

  • result
    optional
    unknown

    The done payload after run.completed.

  • error
    optional
    object | null
    • code
      optional
      string
    • message
      optional
      string
  • usage
    optional
    object
    • input_tokens
      optional
      integer
    • cached_input_tokens
      optional
      integer
    • output_tokens
      optional
      integer
    • reasoning_tokens
      optional
      integer
    • model_steps
      optional
      integer
    • code_calls
      optional
      integer
    • code_cpu_ms
      optional
      integer
    • egress_requests
      optional
      integer
    • egress_bytes
      optional
      integer
    • duration_ms
      optional
      integer
    • credits
      optional
      integer
    • dynamic_worker_ids
      optional
      integer
    • inference
      optional
      cloudraker
      or
      byok
      or
      gateway
    • model_cost_usd
      optional
      number | null

      Raw model cost in USD from the AI Gateway logs of CloudRaker inference. Null until a cost is known. Not credits.

    • model_cost_complete
      optional
      boolean

      False while a step cost is not known yet, or when a step has no reported cost (byok, custom gateway).

  • parent_run_id
    optional
    string

    A child run only: the run that delegated the task.

  • root_run_id
    optional
    string

    A child run only: the first run of the run tree.

  • depth
    optional
    integer

    A child run only: 1 for a child of the root run.

    minimum: 1
  • waiting_for
    optional
    children

    Set while the run waits for the reports of its child runs.

  • tree_credits
    optional
    number

    A run with child runs only: the credits of the run and of all its child runs.

EVENT-STREAM
string

503

Error. See the code table in the guides.
JSON
  • error
    object
    required
    • code
      string
      required
    • message
      string
      required
    • run_id
      optional
      string
    • details
      optional
      unknown

4XX

Error. See the code table in the guides.
JSON
  • error
    object
    required
    • code
      string
      required
    • message
      string
      required
    • run_id
      optional
      string
    • details
      optional
      unknown

Type to search…

↑↓ navigate↵ selectEsc close