Content drafts and editorial generation
Read generated content
Check the generation status and review its candidate copy before applying it to the draft.
- Path
run_idstarts witheditorial_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
| Name | Where | Type | Required | Description |
|---|---|---|---|---|
run_id | path | string | Yes |
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.
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | The requested result. See the fields below for its contents. |
data.billed_units | integer | Yes | The credits charged for this work. |
data.candidate | object | null | No | |
data.candidate.body | string | Conditional | |
data.candidate.claim_support | array of object | Conditional | |
data.candidate.claim_support[].claim_text | string | Conditional | |
data.candidate.claim_support[].passage_id | string (uuid) | Conditional | |
data.candidate.claim_support[].source_excerpt | string | Conditional | |
data.candidate.title | string | Conditional | |
data.draft_id | string (uuid) | Yes | Identifies the draft associated with this result. |
data.generation_id | string (uuid) | Yes | |
data.generator | "model" | "model:live" | "model:synthetic" | null | No | |
data.quote | object | Yes | |
data.quote.call_count | 1 | No | |
data.quote.charge_units | integer | Yes | |
data.quote.purpose | string | Yes | |
data.quote.reserve_units | integer | Yes | |
data.reason | string | null | No | |
data.result | object | No | Finished output from this run. |
data.result.candidate | object | null | No | |
data.result.candidate.body | string | Conditional | |
data.result.candidate.claim_support | array of object | Conditional | |
data.result.candidate.claim_support[].claim_text | string | Conditional | |
data.result.candidate.claim_support[].passage_id | string (uuid) | Conditional | |
data.result.candidate.claim_support[].source_excerpt | string | Conditional | |
data.result.candidate.title | string | Conditional | |
data.source_revision | integer | Yes | |
data.state | "queued" | "running" | "awaiting_approval" | "approved" | "executing" | "verifying" | "completed" | "partial" | "failed" | "cancelled" | "rejected" | "stale_approval" | Yes | |
data.v2_run_id | string | No | The prefixed run ID accepted by GET /v2/runs/{run_id}. |
meta | object | Yes | Information 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.
- HTTP 400
invalid_request - HTTP 401
unauthenticated - HTTP 403
forbidden - HTTP 404
not_found - HTTP 422
validation_error - HTTP 429
rate_limited