Skip to main content

Overview

CREAO supports two API paths for running agents programmatically: Both paths run CREAO agents you own and consume credits from your CREAO account balance. CREAO CLI can also create personal agents, update agents by replacing provided fields, and request natural-language edits. They are current supported paths with different key scopes, route families, and request shapes.
For the CREAO CLI endpoint reference, see the API Reference. For a side-by-side contract summary, see API Paths.
API keys are server-side secrets. Do not put capi_ or cr_sk_ keys in browser frontend code, mobile apps, public repositories, client logs, or analytics events.

Which path should I use?

Use the app-scoped API Trigger when you want a key that can run only one agent. This is the path shown from the agent page in agent.creao.ai, and it uses inputs in the request body. Use CREAO CLI when your backend owns an account-level integration. CREAO CLI keys can create, edit, and run personal agents owned by the same account, use agent_id and input, and support async polling, realtime NDJSON streaming, webhooks, and account-level analytics.

App-scoped API Trigger

Create an app-scoped API key from the agent detail page in agent.creao.ai. The key starts with capi_ and is scoped to that agent.

Create a run

The response is accepted for background execution:

Poll a run

Poll until status becomes completed, failed, or cancelled.

Download generated files

Polling and webhook results include generated files in result.artifacts:
Fetch url with your API key and follow the redirect:
The URL requires authentication on every request. The key must belong to the run’s owner and, if agent-scoped, match the run’s agent. Knowing the URL or file ID alone does not grant access. The endpoint is GET /api/v1/runs/{runId}/artifacts/download?artifactId={artifactId}; pass the artifact’s exact id as the encoded query value. CREAO redirects to a temporary storage URL with a maximum lifetime of one hour (underlying credentials may expire sooner). The storage URL grants access to anyone holding it until it expires. Keep it private. Only send your API key to CREAO; do not forward it to a different origin when following redirects. Curl’s --location strips the Authorization header on cross-origin redirects; do not use --location-trusted. Save the stable CREAO URL, not the redirect destination. If a storage link expires, fetch the stable URL again to obtain a fresh redirect. Older runs also receive stable URLs when polled. Files remain downloadable only while they remain available at their recorded location; polling retains artifact metadata after a file is deleted. Errors use the JSON envelope { "error": "ERROR_CODE" }. Existing PDF quarantine restrictions also apply to these downloads.

Receive the result by webhook

Add webhookUrl to the run request, and CREAO POSTs the result to that URL when the run finishes:
webhookUrl must be a public http or https URL. Localhost, private-network, link-local, and metadata-service targets are rejected when you create the run, or skipped at delivery.
The webhook body:
status is completed or failed. result.chatText is added when the agent’s conversational reply differs from result.text. The webhook carries no error details; poll the run for its errorCode. Every request carries these headers: CREAO makes up to three attempts with short backoff. A non-2xx response, a connection error, or no response within 10 seconds is retried. Redirects are not followed, so a 3xx response counts as a failed attempt. The first 2xx response ends delivery. Delivery is at least once. A retry can repeat a request your endpoint already processed, for example when it timed out before responding. Deduplicate on X-Creao-Delivery-Id (or runId), respond with a 2xx quickly, and do slow work afterwards. Webhooks are best-effort, so keep polling as the fallback. A run that fails before it starts executing, for example for insufficient credits, ends without a webhook.

CREAO CLI

Create an Account API key in Developer Console. CREAO CLI keys start with cr_sk_ and are sent as Bearer tokens to developer.creao.ai/v1/*.
1

Create an Account API key

Open Developer Console, go to API Keys, and create a key. Store the full key immediately because it is shown only once.
2

Find the agent ID

Start a personal-agent creation run through POST /v1/agents and poll it for the new agent_id, or open Agents in Developer Console and copy the agent_id for an existing agent. Browser-based editing, files, schedules, and debugging still live in agent.creao.ai.
3

Create an async run

The API returns 202 Accepted with a run ID and conversation ID:
4

Poll for the result

Poll until status becomes completed, failed, or cancelled.

CREAO CLI reference

Create an agent

JSON body

Returns 202 Accepted with a queued run_id, conversation_id, and agent_id: null. Poll GET /v1/runs/:run_id; when the creation run completes, the response includes the new agent ID in both agent_id and result.agent_id.

Update an agent

Update an agent by replacing provided fields. Omitted fields are unchanged; this endpoint does not interpret natural-language instructions. The body can include any supported create field plus optional release_note. The target must be a personal agent owned by the Account key owner. Team, shared, deleted, or foreign agents return AGENT_NOT_FOUND.

Edit an agent from instructions

Start an async natural-language edit for an agent. Use this when your product wants to say what should change, for example:
Returns 202 Accepted with run_id, agent_id, status, and timestamps. Poll GET /v1/agents/:agent_id/edits/:run_id until status is succeeded, failed, or cancelled.

Create an async run

JSON body

Returns 202 Accepted with a run object.

Get run status

Returns the run object for the authenticated Account key owner.

List runs

Query parameters: Response:

Realtime runs

Use CREAO CLI realtime runs when your backend wants streamed progress and output.
Body fields: Example:
The response is application/x-ndjson. Each line is one { "type": "..." } object. Events include:

Conversations

Pass a previous conversation_id to continue the same thread of work with the same agent through CREAO CLI:

Webhooks

CREAO CLI async runs can deliver the terminal result to your backend:
webhook_url must be a publicly reachable http or https URL. URLs pointing to private networks are rejected.
Delivery works the same way as on the app-scoped path: up to three attempts, no redirects followed, and one X-Creao-Delivery-Id across attempts. See Webhooks for the CREAO CLI payload.

Keep request shapes separate

Do not mix the two route families:

Rate limits

CREAO CLI requests are account-scoped and enforced before execution starts. The Developer Console dashboard shows your plan, available credits, and active rate limit.