Skip to content

    Content drafts and editorial generation

    Read generated content

    Check the generation status and review its candidate copy before applying it to the draft.

    GET /v2/runs/{run_id}

    • Path run_id starts with editorial_generation:.

    Authentication and access

    Authentication
    Bearer API key
    Scopes
    optimizations:read
    Roles
    approver, editor, owner, publisher, service, viewer
    Plans
    Optimizer
    Credits
    No credit charge.

    Parameters

    Request parameters
    NameWhereTypeRequiredDescription
    run_idpathstringYes

    Request body

    Send this request without a body.

    Request examples

    Set AEO_API_BASE_URL to https://api.aeoapi.dev and AEO_API_KEY to your server-side API key. Set the other environment variables to the values for your request.

    curl --fail-with-body -X GET "$AEO_API_BASE_URL/v2/runs/$RUN_ID" \
      -H "Authorization: Bearer $AEO_API_KEY"
    from os import environ
    from aeo_sdk import AeoClient
    
    with AeoClient(environ["AEO_API_KEY"], base_url=environ["AEO_API_BASE_URL"]) as client:
        response = client.v2_get_runs_run_id(
            run_id=environ["RUN_ID"],
        )
        print(response.body)
    import { AeoClient } from "@aeoapi/aeo-sdk";
    
    const client = new AeoClient(process.env.AEO_API_KEY!, {
      baseUrl: process.env.AEO_API_BASE_URL!,
    });
    const response = await client.v2GetRunsRunId(
      process.env.RUN_ID!,
    );
    console.log(response.body);

    Responses

    For a job with data.state, queued and running mean the job is still in progress. Read the result at completed or partial. Stop polling at failed or cancelled.

    HTTP 200

    Successful Response

    application/json

    Response fields are listed below.

    HTTP 200 response fields 1
    NameTypeRequiredDescription
    dataobjectYesThe requested result. See the fields below for its contents.
    data.billed_unitsintegerYesThe credits charged for this work.
    data.candidateobject | nullNo
    data.candidate.bodystringConditional
    data.candidate.claim_supportarray of objectConditional
    data.candidate.claim_support[].claim_textstringConditional
    data.candidate.claim_support[].passage_idstring (uuid)Conditional
    data.candidate.claim_support[].source_excerptstringConditional
    data.candidate.titlestringConditional
    data.draft_idstring (uuid)YesIdentifies the draft associated with this result.
    data.generation_idstring (uuid)Yes
    data.generator"model" | "model:live" | "model:synthetic" | nullNo
    data.quoteobjectYes
    data.quote.call_count1No
    data.quote.charge_unitsintegerYes
    data.quote.purposestringYes
    data.quote.reserve_unitsintegerYes
    data.reasonstring | nullNo
    data.resultobjectNoFinished output from this run.
    data.result.candidateobject | nullNo
    data.result.candidate.bodystringConditional
    data.result.candidate.claim_supportarray of objectConditional
    data.result.candidate.claim_support[].claim_textstringConditional
    data.result.candidate.claim_support[].passage_idstring (uuid)Conditional
    data.result.candidate.claim_support[].source_excerptstringConditional
    data.result.candidate.titlestringConditional
    data.source_revisionintegerYes
    data.state"queued" | "running" | "awaiting_approval" | "approved" | "executing" | "verifying" | "completed" | "partial" | "failed" | "cancelled" | "rejected" | "stale_approval"Yes
    data.v2_run_idstringNoThe prefixed run ID accepted by GET /v2/runs/{run_id}.
    metaobjectYesInformation about this response, including any warnings or pagination details.

    Errors

    Read code and message in the error response. Keep request_id when you contact support.

    Content drafts and editorial generation reference