Get started
Discover a model, set your gateway key, and make one deliberate request.
Sign in and issue your own ar- key in My credentials. Registration may be disabled; contact the administrator when needed. Set ARAGON_BASE_URL to the gateway origin and ARAGON_API_KEY in your runtime. Discover models and capabilities before generating. Reading this page and installing the skill consume no quota.
Related operations: modelsopenai-chat
Get started
Keep gateway credentials in the calling environment.
All scripts send Authorization: Bearer using ARAGON_API_KEY. LLM routes also accept x-api-key, but not a session cookie alone. Media routes and capabilities additionally accept console sessions. Revoked keys and disabled or deleted accounts return 401. Call from your backend or agent environment; cross-origin browser CORS access is not provided. Never forward the gateway key to external asset URLs.
Administrators and their keys can manage all jobs and assets. Ordinary accounts can manage their account records using any of their valid keys. Records without a user belong only to their originating system key; a system key is not an administrator. Unknown and unauthorized resources both return 404.
Get started
Read live availability, limits, and personal quota before calling.
GET /api/v1/models returns object=list with data entries containing id, object, owned_by, provider and optional display_name. An empty list is valid. Choose the matching endpoint for openai or anthropic. A route provider does not reveal its protocol: ask the administrator and send the public model id. The gateway does not translate protocols.
GET /api/v1/capabilities returns six entries with id, kind, label, enabled, available, unavailableReason, limits and quota. available does not guarantee quota or future success. Image limits.models contains string ids; video models are objects with id, label, profile, modes, resolutions, maxRefImages, supportsLastFrame and supportsCameraFixed. Use object.id, not the object. TTS limits.voices also contains objects: use voices[].id or defaultVoice. Empty defaults do not authorize guessing a model or voice. Built-in video descriptions do not prove entitlement.
GET/api/v1/models
Authentication: keySuccess status: 200
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/models"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
status=$(curl --silent --show-error --max-time 600 -X GET "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)GET /api/v1/models returns object=list with data entries containing id, object, owned_by, provider and optional display_name. An empty list is valid. Choose the matching endpoint for openai or anthropic. A route provider does not reveal its protocol: ask the administrator and send the public model id. The gateway does not translate protocols.
Response · application/json
{
"object": "list",
"data": [
{
"id": "public-model-id",
"object": "model",
"owned_by": "gateway",
"provider": "openai",
"display_name": "Public model"
}
]
}GET/api/v1/capabilities
Authentication: key-or-sessionSuccess status: 200
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/capabilities"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
status=$(curl --silent --show-error --max-time 600 -X GET "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)Set the runtime variables before running. Refuse redirects and preserve errors.
Response · application/json
{
"data": [
{
"id": "ai_image",
"kind": "generate",
"label": {
"en": "AI image",
"zh": "AI image"
},
"enabled": true,
"available": true,
"unavailableReason": null,
"limits": {
"models": [
"public-image-model"
],
"sizes": [
"1024x1024",
"2048x2048",
"1280x720",
"720x1280",
"1024x576",
"576x1024"
],
"defaultSize": "2048x2048",
"promptMaxChars": 2000,
"maxCount": 4,
"maxReferenceImages": 1,
"watermarkDefault": true
},
"quota": {
"unit": "image",
"dailyLimit": 10,
"used": 1,
"remaining": 9,
"resetsAt": 1800057600000
}
},
{
"id": "ai_video",
"kind": "async",
"label": {
"en": "AI video",
"zh": "AI video"
},
"enabled": true,
"available": true,
"unavailableReason": null,
"limits": {
"models": [
{
"id": "public-video-model",
"label": "Public video",
"profile": "seedance_2",
"modes": [
"description",
"keyframe",
"reference"
],
"resolutions": [
"480p",
"720p",
"1080p"
],
"maxRefImages": 4,
"supportsLastFrame": true,
"supportsCameraFixed": false
}
],
"duration": {
"min": 4,
"max": 12,
"default": 5
},
"aspectRatios": [
"16:9",
"9:16",
"1:1"
],
"promptMaxChars": 2000
},
"quota": {
"unit": "video",
"dailyLimit": 0,
"used": 0,
"remaining": null,
"resetsAt": 1800057600000
}
},
{
"id": "tts",
"kind": "stream",
"label": {
"en": "Speech",
"zh": "Speech"
},
"enabled": true,
"available": true,
"unavailableReason": null,
"limits": {
"voices": [
{
"id": "discovered-voice",
"label": "Voice",
"category": "Example",
"language": "en-US",
"generation": "2.0"
}
],
"defaultVoice": "discovered-voice",
"maxChars": 1000,
"speed": {
"min": 0.5,
"max": 2,
"default": 1
},
"formats": [
"mp3"
]
},
"quota": {
"unit": "thousand_chars",
"dailyLimit": 0,
"used": 0,
"remaining": null,
"resetsAt": 1800057600000
}
},
{
"id": "image_search",
"kind": "search",
"label": {
"en": "image_search",
"zh": "image_search"
},
"enabled": true,
"available": true,
"unavailableReason": null,
"limits": {
"perPage": {
"max": 30,
"default": 20
},
"orientations": [
"landscape",
"portrait",
"squarish"
],
"colors": [
"black_and_white",
"black",
"white",
"yellow",
"orange",
"red",
"purple",
"magenta",
"green",
"teal",
"blue"
],
"orderBy": [
"relevant",
"latest"
]
},
"quota": {
"unit": "search",
"dailyLimit": 0,
"used": 0,
"remaining": null,
"resetsAt": 1800057600000
}
},
{
"id": "video_search",
"kind": "search",
"label": {
"en": "video_search",
"zh": "video_search"
},
"enabled": true,
"available": true,
"unavailableReason": null,
"limits": {
"perPage": {
"max": 80,
"default": 20
},
"orientations": [
"landscape",
"portrait",
"mixed"
]
},
"quota": {
"unit": "search",
"dailyLimit": 0,
"used": 0,
"remaining": null,
"resetsAt": 1800057600000
}
},
{
"id": "audio_search",
"kind": "search",
"label": {
"en": "audio_search",
"zh": "audio_search"
},
"enabled": true,
"available": true,
"unavailableReason": null,
"limits": {
"perPage": {
"max": 150,
"default": 20
},
"audioTypes": [
"music",
"sound-effect",
"speech",
"ambient",
"nature"
],
"sorts": [
"score",
"downloads_desc",
"rating_desc",
"created_desc",
"created_asc",
"duration_asc",
"duration_desc"
],
"duration": {
"minSeconds": 0,
"maxSeconds": 3600
}
},
"quota": {
"unit": "search",
"dailyLimit": 0,
"used": 0,
"remaining": null,
"resetsAt": 1800057600000
}
}
]
}GET/api/v1/plan
Authentication: keySuccess status: 200
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/plan"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
status=$(curl --silent --show-error --max-time 600 -X GET "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)GET /api/v1/plan returns the plan of the key owner (plan, period, limits, usage, exempt). Monthly requests, monthly tokens and requests per minute are counted on the two LLM endpoints only; a refused call answers 429 with plan_quota_exceeded or plan_rate_limited before any upstream is contacted. The 429 body carries error.code, plan, limit, window, resets_at (quota) or retry_after_s (per minute) and upgrade_url. A quota refusal sends x-should-retry: false (do not retry until resets_at); a per-minute refusal sends Retry-After. Read usage.resetsAt to know when the window rolls over. Administrators and system keys answer exempt=true with zero limits.
Response · application/json
{
"data": {
"plan": {
"id": "advanced",
"name": "Advanced",
"tier": "premium"
},
"period": {
"start": 1795000000000,
"end": 1797592000000
},
"limits": {
"requests": 50000,
"tokens": 10000000,
"rpm": 60,
"keys": 10,
"mediaQuotaPct": 200
},
"usage": {
"windowStart": 1795000000000,
"resetsAt": 1797592000000,
"requests": 7420,
"inputTokens": 812345,
"outputTokens": 402110,
"activeKeys": 3
},
"exempt": false
}
}Language models
Use chat/completions with a discovered public model id.
Send model and messages, with max_tokens:64 for the minimal example. Read choices[0].message.content. Success retains the upstream OpenAI response shape. Gateway errors use type=error and error.type/message. An optional OpenAI SDK uses base_url=ORIGIN + /api/v1 and max_retries=0. Do not repeat /v1 or send an internal route target id.
POST/api/v1/chat/completions
Authentication: keySuccess status: 200
| Field | Type | Description |
|---|---|---|
| modelRequired | string | Public model id from live discovery; empty examples must be replaced. |
| messagesRequired | array | Messages in the selected upstream protocol. |
| max_tokensOptional | integer | Maximum generated tokens; example budget 64. |
| streamOptional | boolean | Use SSE when true; handle event framing and terminal markers.false |
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/chat/completions"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
payload=$(cat <<'ARAGON_JSON'
{
"model": "REPLACE_WITH_DISCOVERED_MODEL",
"messages": [
{
"role": "user",
"content": "Hello, world"
}
],
"max_tokens": 64,
"stream": false
}
ARAGON_JSON
)
status=$(curl --silent --show-error --max-time 600 -X POST "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "$payload" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)Replace REPLACE_WITH_DISCOVERED_MODEL with a supported public model id.
Set the runtime variables before running. Refuse redirects and preserve errors.
Response · application/json | text/event-stream
{
"id": "chat-example",
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 2
}
}Incremental streaming
# POSIX shell + curl; displays raw SSE events. Check the protocol terminal marker.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
work=$(mktemp -d)
trap 'rm -f "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
payload=$(cat <<'ARAGON_JSON'
{
"model": "REPLACE_WITH_DISCOVERED_MODEL",
"messages": [
{
"role": "user",
"content": "Hello, world"
}
],
"max_tokens": 64,
"stream": true
}
ARAGON_JSON
)
# --fail-with-body rejects HTTP errors; the final check also rejects redirects.
status=$(curl --no-buffer --silent --show-error --fail-with-body --max-time 600 \
-X POST "$ORIGIN/api/v1/chat/completions" -H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'Accept: text/event-stream' \
-H 'Content-Type: application/json; charset=utf-8' --data-binary "$payload" \
--dump-header "$work/headers" --output /dev/stderr --write-out "%{http_code}")
[ "$status" = 200 ] || { echo "Unexpected HTTP $status" >&2; exit 1; }
grep -Ei '^content-type:[[:space:]]*text/event-stream' "$work/headers" >/dev/null || exit 1
# OpenAI: [DONE]; Anthropic: message_stop, error means failure.
# EOF without the marker means possible truncation; do not automatically resend.
)Replace REPLACE_WITH_DISCOVERED_MODEL with a supported public model id.
Set the runtime variables before running. Refuse redirects and preserve errors.
Response · application/json | text/event-stream
data: {"choices":[{"delta":{"content":"Hello"}}]}
data: [DONE]
Language models
Use messages with max_tokens and the native Anthropic response.
Send model, messages and max_tokens. The example sends anthropic-version: 2023-06-01; the gateway can supply its configured default when absent. Read text blocks in content. The optional Anthropic SDK uses base_url=ORIGIN + /api and max_retries=0, since the SDK appends /v1/messages. Model support follows the selected upstream protocol.
POST/api/v1/messages
Authentication: keySuccess status: 200
| Field | Type | Description |
|---|---|---|
| modelRequired | string | Public model id from live discovery; empty examples must be replaced. |
| messagesRequired | array | Messages in the selected upstream protocol. |
| max_tokensRequired | integer | Maximum generated tokens; example budget 64. |
| streamOptional | boolean | Use SSE when true; handle event framing and terminal markers.false |
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/messages"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
payload=$(cat <<'ARAGON_JSON'
{
"model": "REPLACE_WITH_DISCOVERED_MODEL",
"messages": [
{
"role": "user",
"content": "Hello, world"
}
],
"max_tokens": 64,
"stream": false
}
ARAGON_JSON
)
status=$(curl --silent --show-error --max-time 600 -X POST "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'anthropic-version: 2023-06-01' \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "$payload" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)Replace REPLACE_WITH_DISCOVERED_MODEL with a supported public model id.
Set the runtime variables before running. Refuse redirects and preserve errors.
Response · application/json | text/event-stream
{
"id": "message-example",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello"
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 10,
"output_tokens": 2
}
}Incremental streaming
# POSIX shell + curl; displays raw SSE events. Check the protocol terminal marker.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
work=$(mktemp -d)
trap 'rm -f "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
payload=$(cat <<'ARAGON_JSON'
{
"model": "REPLACE_WITH_DISCOVERED_MODEL",
"messages": [
{
"role": "user",
"content": "Hello, world"
}
],
"max_tokens": 64,
"stream": true
}
ARAGON_JSON
)
# --fail-with-body rejects HTTP errors; the final check also rejects redirects.
status=$(curl --no-buffer --silent --show-error --fail-with-body --max-time 600 \
-X POST "$ORIGIN/api/v1/messages" -H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'anthropic-version: 2023-06-01' \
-H 'Accept: text/event-stream' \
-H 'Content-Type: application/json; charset=utf-8' --data-binary "$payload" \
--dump-header "$work/headers" --output /dev/stderr --write-out "%{http_code}")
[ "$status" = 200 ] || { echo "Unexpected HTTP $status" >&2; exit 1; }
grep -Ei '^content-type:[[:space:]]*text/event-stream' "$work/headers" >/dev/null || exit 1
# OpenAI: [DONE]; Anthropic: message_stop, error means failure.
# EOF without the marker means possible truncation; do not automatically resend.
)Replace REPLACE_WITH_DISCOVERED_MODEL with a supported public model id.
Set the runtime variables before running. Refuse redirects and preserve errors.
Response · application/json | text/event-stream
event: content_block_delta
data: {"type":"content_block_delta","delta":{"type":"text_delta","text":"Hello"}}
event: message_stop
data: {"type":"message_stop"}
Language models
Models that carry reflection, genes and memory from the router.
For models an administrator has switched on, the router appends a short advisory block to the end of your last user message: notes you saved, relevant experience and, in long tasks, a second opinion from a fast reviewer. Your request is otherwise unchanged and the response is never rewritten. Send x-aragon-agent: off to skip it for one request, and x-aragon-conversation to separate conversations that start with the same text. An administrator may also publish organization guidance, read-only notes such as house style or terminology, which ride in the same block when they apply to your model and plan; the same header opts out, and text that must always apply belongs in the route system prompt instead.
When a request was augmented, the response carries x-aragon-agent with counts only, for example "reflection; guidance=1; gene=2; memory=3" (guidance counts organization guidance). GET /api/v1/agent reports what would apply to your key. After a preflight wait the value ends with "; wait=<ms>".
By default the reviewer runs after your response and its advice reaches the next request, so latency is unchanged. An administrator may instead choose preflight: only on a request that ends with a tool result, the router waits for the reviewer up to a limit the administrator sets, then forwards the request either way. When it waited, the header ends with "; wait=<ms>", for example "reflection; gene=2; wait=1840", and the request log duration includes that wait. GET /api/v1/agent shows reflectionMode per model ("after" or "preflight").
In a chat message, start a line with #remember followed by the text and the router saves it to your memory and has the model confirm in one sentence. Text that looks like a secret is refused and not saved.
No x-aragon-agent header usually means one of: the model is not switched on for your tier, your master switch is off, an administrator disabled the layer for you, the daily fast-model allowance is used up, the conversation has no user message to attach to, or the fast model is temporarily unavailable. Send x-aragon-agent: off to see whether the augmentation caused a problem. If an augmented request is answered with HTTP 400, ask the administrator to run the compatibility check for that model; the router never retries a request without the augmentation.
GET/api/v1/agent
Authentication: keySuccess status: 200
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/agent"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
status=$(curl --silent --show-error --max-time 600 -X GET "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)When a request was augmented, the response carries x-aragon-agent with counts only, for example "reflection; guidance=1; gene=2; memory=3" (guidance counts organization guidance). GET /api/v1/agent reports what would apply to your key. After a preflight wait the value ends with "; wait=<ms>".
Response · application/json
{
"data": {
"layer": "on",
"enabled": true,
"subject": true,
"user": {
"enabled": true,
"reflection": true,
"geneUse": true,
"memoryUse": true,
"geneLearning": "suggest",
"memoryLearning": "suggest"
},
"models": [
{
"id": "public-model-id",
"reflection": true,
"gene": true,
"memory": true,
"reflectionMode": "after"
}
],
"counts": {
"genes": 12,
"memories": 37,
"inbox": 3
},
"capability": {
"enabled": true,
"active": true,
"sources": {
"lexicon": true,
"reflection": true,
"gap": true
},
"pass": true
}
}
}Language models
Your Agent learns about image, video, speech and stock-media generation from the router, with nothing installed.
When an administrator switches capability hints on and your request clearly asks for an image, a video, a voice-over or stock media, the router appends a short block to your last user message that names the matching AragonRouter capability, the one HTTP call that uses it and how to fetch the result. Most requests get nothing, so the extra context is zero. The block never changes your instructions or tool permissions; when task triage is on (below) it is worded as a directive about the task instead of optional documentation. A client that cannot send an HTTP POST receives one sentence that points to the Studio page instead. If an AragonRouter Skill is already installed, it keeps priority.
The block carries a capability pass: arp1.… in the Authorization bearer header, valid for about 20 minutes, for the capabilities named in the block only, and only for the generation, search, ingest, job-read and asset-read endpoints. It reads and writes only what its own key produced and cannot call the LLM endpoints, delete assets or cancel jobs. It may appear in the logs of your model provider, like the rest of the request.
Send x-aragon-capabilities: off to skip the block for one request (x-aragon-agent: off skips every augmentation). Members can switch it off under Agent settings; it needs reflection to be on. The response header x-aragon-agent adds capability=<n> when a block was attached.
Task triage: when a new task arrives from a client that can run shell commands or scripts, the router can ask the fast model about it in the same request, so a need the keyword list cannot see (for example a landing page that needs a hero image) is attached to that very request. The router waits for the fast model for a bounded time (waitMs, 2.5 s by default); if the keyword list already matched, triage runs in the background and its answer rides the next request. The response header x-aragon-agent then carries a triage=<outcome> segment with one of five words: hit, none, timeout, late or detached. While the Agent has not called the capability yet, short reminder blocks repeat the call shape (at most 5 reminders over 12 requests) because the block is not part of your client history. Each triaged task costs one fast-model call and sends the task text to the fast-model provider; text that looks like a secret is skipped. The router has not verified that real clients follow the block.
When a task reaches the router from a client with a shell or script tool, and nothing more specific speaks for that task, the router attaches one short deterministic menu (under 320 characters, at most once per task) naming the capabilities this key may use today, one HTTP path each. It needs no fast model, causes no wait and carries no capability pass: use the same API key as this LLM connection, or read GET /api/v1/capabilities for the shapes. It is background knowledge, so it says only "use one if the task needs it". A deployment can switch it off, and then every request is byte-for-byte what it was before this block existed.
When a capability call fails, the router answers the next request of that task with the smallest block that changes what the Agent does next, chosen from the error code in the tool result: a fresh pass when the old one expired, the request fields once per task when the body was malformed, one "wait or tell the user" line plus a few quiet requests when the call was rate limited or out of quota, one "retry it now, it was free" line when the error body says retryable: true (the request never reached the upstream), or a final sentence with the Studio as the way out when this key can never make that call. The codes a failed job reports (job.error.code, for example submission_unknown) are classified the same way, and the capability they belong to is read from the job body itself. The response header x-aragon-agent does not change shape; the block is bounded per task and never repeats itself. The router has not verified that real clients surface the error body it reads.
The call line follows the shell the client exposes. With only PowerShell available it reads: use curl.exe (not the curl alias) or Invoke-RestMethod, write the JSON body to a file and send it with --data-binary "@file.json". x-aragon-capabilities: off still switches off everything described here, triage and reminders included.
Related operations: capabilities
GET/api/v1/capabilities/{id}/guide
Authentication: key-or-sessionSuccess status: 200
| Field | Type | Description |
|---|---|---|
| idRequired | path string | Capability id: ai_image, ai_video, tts, image_search, video_search or audio_search. |
| langOptional | string | Language of the headings, en or zh-CN.en |
| shellOptional | string | Shell the example command is written for: posix or powershell.posix |
Download bytes
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
command -v jq >/dev/null || { echo "Requires jq >=1.6" >&2; exit 2; }
: "${ARAGON_CAPABILITY_ID:?Set ARAGON_CAPABILITY_ID}"
case "$ARAGON_CAPABILITY_ID" in .|..) exit 2 ;; esac
resource_id=$(printf "%s" "$ARAGON_CAPABILITY_ID" | jq -sRr @uri)
path='/api/v1/capabilities//guide'
url="$ORIGIN/api/v1/capabilities/$resource_id/guide"
work=$(mktemp -d "./.aragon-download.XXXXXXXX")
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
status=$(curl --silent --show-error --max-time 600 -X GET "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in text/markdown) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
mv "$work/body" 'aragon-asset.bin'
printf '%s\n' 'aragon-asset.bin'
# Normal EOF cannot prove semantic audio completeness.
)GET /api/v1/capabilities/{id}/guide returns the full guide of one capability as Markdown (at most 6 KB), including your own limits and quota. The block links to it; nothing fetches it for you.
Response · text/markdown
Download bytes · text/markdownLanguage models
Handle complete SSE events and detect truncated generations.
Set stream:true and Accept:text/event-stream. SSE events end at blank lines, not at network chunk boundaries; data may span multiple lines and UTF-8 characters may span chunks. OpenAI ends with [DONE]; Anthropic ends with message_stop, while error is a failure. EOF before a terminal marker means a possibly truncated generation. Preserve received text and do not automatically resubmit. curl displays raw events; Python requires requests and Node.js requires 22.5 or later with an .mjs file.
Related operations: openai-chatanthropic-messages
Language models
Short instructions the router delivers with your own requests, with nothing installed.
GET /api/v1/skills lists the skills a key may receive: the platform library plus the key owner's own published skills, filtered by plan, by model and by enabled. Each entry carries slug, name, description, when, tags, version, scope and units, where units is the cost of the full card so a client can decide whether to expand it. GET /api/v1/skills/{slug} returns one skill as text/markdown, with an ETag and a private one-minute cache; sending If-None-Match answers 304. Neither call spends quota, and a slug that belongs to someone else answers exactly like one that does not exist.
Two request headers tune the delivery of one call. x-aragon-skills: off skips skills for that request only - it lowers, it never raises. x-aragon-skills: slug-a,slug-b promotes up to three skills for that request; promotion changes order only, so every gate (enabled, status, scope, plan, model, the card ceiling and the budget) still applies, and an unknown slug is ignored silently.
When skills rode along, the response header x-aragon-agent gains a skill=<n> segment with the number of cards placed; the segments that were already there keep their meaning and their order. The request log stores the same placement in agent_applied as an s<n> run. GET /api/v1/agent reports what would apply to this key before you send anything.
Related operations: agent-status
GET/api/v1/skills
Authentication: keySuccess status: 200
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/skills"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
status=$(curl --silent --show-error --max-time 600 -X GET "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)GET /api/v1/skills lists the skills a key may receive: the platform library plus the key owner's own published skills, filtered by plan, by model and by enabled. Each entry carries slug, name, description, when, tags, version, scope and units, where units is the cost of the full card so a client can decide whether to expand it. GET /api/v1/skills/{slug} returns one skill as text/markdown, with an ETag and a private one-minute cache; sending If-None-Match answers 304. Neither call spends quota, and a slug that belongs to someone else answers exactly like one that does not exist.
Two request headers tune the delivery of one call. x-aragon-skills: off skips skills for that request only - it lowers, it never raises. x-aragon-skills: slug-a,slug-b promotes up to three skills for that request; promotion changes order only, so every gate (enabled, status, scope, plan, model, the card ceiling and the budget) still applies, and an unknown slug is ignored silently.
Response · application/json
{
"object": "list",
"has_more": false,
"data": [
{
"slug": "report-weekly",
"name": "Weekly report",
"description": "Writes the weekly report from the template",
"when": "the user asks for the weekly report",
"tags": [
"writing"
],
"version": 3,
"scope": "platform",
"units": 412
}
]
}GET/api/v1/skills/{slug}
Authentication: keySuccess status: 200 / 304
Download bytes
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
command -v jq >/dev/null || { echo "Requires jq >=1.6" >&2; exit 2; }
: "${ARAGON_SKILL_SLUG:?Set ARAGON_SKILL_SLUG}"
case "$ARAGON_SKILL_SLUG" in .|..) exit 2 ;; esac
resource_id=$(printf "%s" "$ARAGON_SKILL_SLUG" | jq -sRr @uri)
path='/api/v1/skills/'
url="$ORIGIN/api/v1/skills/$resource_id"
work=$(mktemp -d "./.aragon-download.XXXXXXXX")
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
status=$(curl --silent --show-error --max-time 600 -X GET "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'If-None-Match: "0123456789abcdef"' \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in text/markdown) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
mv "$work/body" 'aragon-asset.bin'
printf '%s\n' 'aragon-asset.bin'
# Normal EOF cannot prove semantic audio completeness.
)GET /api/v1/skills lists the skills a key may receive: the platform library plus the key owner's own published skills, filtered by plan, by model and by enabled. Each entry carries slug, name, description, when, tags, version, scope and units, where units is the cost of the full card so a client can decide whether to expand it. GET /api/v1/skills/{slug} returns one skill as text/markdown, with an ETag and a private one-minute cache; sending If-None-Match answers 304. Neither call spends quota, and a slug that belongs to someone else answers exactly like one that does not exist.
When skills rode along, the response header x-aragon-agent gains a skill=<n> segment with the number of cards placed; the segments that were already there keep their meaning and their order. The request log stores the same placement in agent_applied as an s<n> run. GET /api/v1/agent reports what would apply to this key before you send anything.
Response · text/markdown
Download bytes · text/markdownPOST/api/v1/skills/{slug}/feedback
Authentication: keySuccess status: 200
| Field | Type | Description |
|---|---|---|
| slugRequired | path string | The slug of a skill this key can read. |
| verdictRequired | string | One of helped, misleading, not_applicable or outdated. not_applicable means the card was irrelevant to the task (a retrieval problem), not that the content is wrong. |
| noteOptional | string | An optional short note, at most 200 characters. |
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
command -v jq >/dev/null || { echo "Requires jq >=1.6" >&2; exit 2; }
: "${ARAGON_SKILL_SLUG:?Set ARAGON_SKILL_SLUG}"
case "$ARAGON_SKILL_SLUG" in .|..) exit 2 ;; esac
resource_id=$(printf "%s" "$ARAGON_SKILL_SLUG" | jq -sRr @uri)
path='/api/v1/skills//feedback'
url="$ORIGIN/api/v1/skills/$resource_id/feedback"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
payload=$(cat <<'ARAGON_JSON'
{
"verdict": "helped",
"note": "the template saved a rewrite"
}
ARAGON_JSON
)
status=$(curl --silent --show-error --max-time 600 -X POST "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "$payload" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)POST /api/v1/skills/{slug}/feedback records one verdict about a card that was delivered: helped, misleading, not_applicable or outdated, with an optional note of up to 200 characters. It answers counts only - helped, misleading, flagged, pinCleared - never the skill itself. Three verdicts per skill per key per day; the fourth answers 409 SKILL_LIMIT_REACHED. A verdict never switches a skill off: at most it flags it for review, which costs its pin slot and nothing else. A slug that belongs to somebody else answers the same 404 as one that does not exist.
Response · application/json
{
"data": {
"helped": 4,
"misleading": 0,
"flagged": false,
"pinCleared": false
}
}Language models
Read which workflows a key may use, then read and drive one run of it.
GET /api/v1/graphs lists the workflows this key can hit right now: the name, the status, how it triggers and the id of its last run. It never returns the workflow body - that arrives compiled into the envelope the gateway attaches to your own requests - and it never lists another account's workflows. GET /api/v1/graphs/runs/{runId} answers where a run is: the current step, its goal, the sentence that completes it, how many steps are done, and the two or three paths that leave it. Both calls spend no quota.
POST /api/v1/graphs/runs/{runId}/events with an outcome of ok, blocked or skipped reports that a step is finished; only ok advances the run, because the gateway cannot guess which path a blocked step should have taken. Reporting the same (runId, step, outcome) again answers 200 without advancing twice, so a retried call is always safe. POST /api/v1/graphs/runs/{runId}/abandon gives up explicitly. A run that is already finished answers 409 GRAPH_RUN_FINISHED.
Related operations: agent-status
GET/api/v1/graphs
Authentication: keySuccess status: 200
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/graphs"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
status=$(curl --silent --show-error --max-time 600 -X GET "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)GET /api/v1/graphs lists the workflows this key can hit right now: the name, the status, how it triggers and the id of its last run. It never returns the workflow body - that arrives compiled into the envelope the gateway attaches to your own requests - and it never lists another account's workflows. GET /api/v1/graphs/runs/{runId} answers where a run is: the current step, its goal, the sentence that completes it, how many steps are done, and the two or three paths that leave it. Both calls spend no quota.
Response · application/json
{
"object": "list",
"data": [
{
"id": "gw_3f9c1b2a4d",
"name": "Review before publishing",
"status": "published",
"triggers": {
"mode": "deterministic"
},
"lastRun": {
"id": "r_8a1d2f4c",
"status": "active",
"updatedAt": 1800000010000
}
}
]
}GET/api/v1/graphs/runs/{runId}
Authentication: keySuccess status: 200
| Field | Type | Description |
|---|---|---|
| runIdRequired | path string | The run id from the workflow list or from the attached envelope. |
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
command -v jq >/dev/null || { echo "Requires jq >=1.6" >&2; exit 2; }
: "${ARAGON_RUN_ID:?Set ARAGON_RUN_ID}"
case "$ARAGON_RUN_ID" in .|..) exit 2 ;; esac
resource_id=$(printf "%s" "$ARAGON_RUN_ID" | jq -sRr @uri)
path='/api/v1/graphs/runs/'
url="$ORIGIN/api/v1/graphs/runs/$resource_id"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
status=$(curl --silent --show-error --max-time 600 -X GET "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)GET /api/v1/graphs lists the workflows this key can hit right now: the name, the status, how it triggers and the id of its last run. It never returns the workflow body - that arrives compiled into the envelope the gateway attaches to your own requests - and it never lists another account's workflows. GET /api/v1/graphs/runs/{runId} answers where a run is: the current step, its goal, the sentence that completes it, how many steps are done, and the two or three paths that leave it. Both calls spend no quota.
Response · application/json
{
"data": {
"runId": "r_8a1d2f4c",
"workflowId": "gw_3f9c1b2a4d",
"status": "active",
"currentNode": {
"id": "n_5b1e0a7c",
"title": "Check every factual claim",
"purpose": "Verify the claims and cite a source for each",
"doneWhen": "Every claim has a source; unverified ones are marked"
},
"stepsDone": 2,
"next": [
{
"edgeId": "e_11a2b3c4",
"label": "passed",
"toTitle": "Summarise the list"
},
{
"edgeId": "e_22d4e5f6",
"label": "blocked",
"toTitle": "Ask the author"
}
]
}
}POST/api/v1/graphs/runs/{runId}/events
Authentication: keySuccess status: 200
| Field | Type | Description |
|---|---|---|
| runIdRequired | path string | The run id from the workflow list or from the attached envelope. |
| outcomeRequired | string | One of ok, blocked or skipped. ok advances the run by one step; the other two are recorded and leave the run where it is. |
| noteOptional | string | An optional sentence the platform may use to judge the step. |
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
command -v jq >/dev/null || { echo "Requires jq >=1.6" >&2; exit 2; }
: "${ARAGON_RUN_ID:?Set ARAGON_RUN_ID}"
case "$ARAGON_RUN_ID" in .|..) exit 2 ;; esac
resource_id=$(printf "%s" "$ARAGON_RUN_ID" | jq -sRr @uri)
path='/api/v1/graphs/runs//events'
url="$ORIGIN/api/v1/graphs/runs/$resource_id/events"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
payload=$(cat <<'ARAGON_JSON'
{
"outcome": "ok",
"note": "each claim now carries a source"
}
ARAGON_JSON
)
status=$(curl --silent --show-error --max-time 600 -X POST "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "$payload" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)POST /api/v1/graphs/runs/{runId}/events with an outcome of ok, blocked or skipped reports that a step is finished; only ok advances the run, because the gateway cannot guess which path a blocked step should have taken. Reporting the same (runId, step, outcome) again answers 200 without advancing twice, so a retried call is always safe. POST /api/v1/graphs/runs/{runId}/abandon gives up explicitly. A run that is already finished answers 409 GRAPH_RUN_FINISHED.
Response · application/json
{
"data": {
"runId": "r_8a1d2f4c",
"workflowId": "gw_3f9c1b2a4d",
"status": "active",
"currentNode": {
"id": "n_7c2f9d31",
"title": "Summarise the list",
"purpose": "",
"doneWhen": ""
},
"stepsDone": 3,
"next": []
},
"advanced": true
}POST/api/v1/graphs/runs/{runId}/abandon
Authentication: keySuccess status: 200
| Field | Type | Description |
|---|---|---|
| runIdRequired | path string | The run id from the workflow list or from the attached envelope. |
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
command -v jq >/dev/null || { echo "Requires jq >=1.6" >&2; exit 2; }
: "${ARAGON_RUN_ID:?Set ARAGON_RUN_ID}"
case "$ARAGON_RUN_ID" in .|..) exit 2 ;; esac
resource_id=$(printf "%s" "$ARAGON_RUN_ID" | jq -sRr @uri)
path='/api/v1/graphs/runs//abandon'
url="$ORIGIN/api/v1/graphs/runs/$resource_id/abandon"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
status=$(curl --silent --show-error --max-time 600 -X POST "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)POST /api/v1/graphs/runs/{runId}/events with an outcome of ok, blocked or skipped reports that a step is finished; only ok advances the run, because the gateway cannot guess which path a blocked step should have taken. Reporting the same (runId, step, outcome) again answers 200 without advancing twice, so a retried call is always safe. POST /api/v1/graphs/runs/{runId}/abandon gives up explicitly. A run that is already finished answers 409 GRAPH_RUN_FINISHED.
Response · application/json
{
"data": {
"runId": "r_8a1d2f4c",
"status": "abandoned",
"endReason": "user"
}
}Media generation
Generate one or more images and handle partial success safely.
prompt is required, with a factory maximum of 2000 characters. count defaults to 1 and ranges from 1 to 4. size comes from limits.sizes, factory default 2048x2048; model must be configured and serviceable. watermark defaults to true. referenceImage accepts one HTTPS URL, image data URI or owned gateway asset path, subject to SSRF, ownership and size checks. Use count and referenceImage rather than upstream n or image fields.
HTTP 200 contains data.assets, failed, optional errors, model and latencyMs. A partial result is still 200: use completed assets and never resend the entire batch merely because failed is positive. Quota is reserved by count and refunded only for failures the server determines refundable. Disconnects, submission_unknown, and storage failures after delivery may remain billed; neither assets.length nor failed proves the final debit. Check authenticated quota after uncertainty.
POST/api/v1/media/images/generations
Authentication: key-or-sessionSuccess status: 200
| Field | Type | Description |
|---|---|---|
| promptRequired | string | Nonempty prompt; factory maximum 2000 characters. |
| countOptional | integer | Integer 1–4. Quota is initially reserved by count.1 |
| sizeOptional | string | Choose a size from live limits.sizes.ai_image.limits.sizes |
| modelOptional | string | Public model id from live discovery; empty examples must be replaced.ai_image.limits.models |
| watermarkOptional | boolean | Whether the selected model applies a watermark.true |
| referenceImageOptional | string | One HTTPS URL, image data URI or owned gateway asset. |
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/media/images/generations"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
payload=$(cat <<'ARAGON_JSON'
{
"prompt": "A red apple on a white table",
"count": 1
}
ARAGON_JSON
)
status=$(curl --silent --show-error --max-time 600 -X POST "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "$payload" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)Set the runtime variables before running. Refuse redirects and preserve errors.
Response · application/json
{
"data": {
"assets": [
{
"id": "asset-example",
"kind": "image",
"mime": "image/png",
"bytes": 1024,
"width": 2048,
"height": 2048,
"durationMs": null,
"url": "/api/v1/media/assets/asset-example",
"title": null,
"origin": "generated",
"createdAt": 1800000000000,
"expiresAt": null,
"attribution": null
}
],
"failed": 0,
"model": "public-image-model",
"latencyMs": 1000
}
}Partial image result
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/media/images/generations"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
payload=$(cat <<'ARAGON_JSON'
{
"prompt": "A red apple on a white table",
"count": 2
}
ARAGON_JSON
)
status=$(curl --silent --show-error --max-time 600 -X POST "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "$payload" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)HTTP 200 contains data.assets, failed, optional errors, model and latencyMs. A partial result is still 200: use completed assets and never resend the entire batch merely because failed is positive. Quota is reserved by count and refunded only for failures the server determines refundable. Disconnects, submission_unknown, and storage failures after delivery may remain billed; neither assets.length nor failed proves the final debit. Check authenticated quota after uncertainty.
Response · application/json
{
"data": {
"assets": [
{
"id": "asset-example",
"kind": "image",
"mime": "image/png",
"bytes": 1024,
"width": 2048,
"height": 2048,
"durationMs": null,
"url": "/api/v1/media/assets/asset-example",
"title": null,
"origin": "generated",
"createdAt": 1800000000000,
"expiresAt": null,
"attribution": null
}
],
"failed": 1,
"errors": [
{
"code": "upstream_unavailable",
"message": "One image failed"
}
],
"model": "public-image-model",
"latencyMs": 1000
}
}Possibly billed image failure
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/media/images/generations"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
payload=$(cat <<'ARAGON_JSON'
{
"prompt": "A red apple on a white table",
"count": 2
}
ARAGON_JSON
)
status=$(curl --silent --show-error --max-time 600 -X POST "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "$payload" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)HTTP 200 contains data.assets, failed, optional errors, model and latencyMs. A partial result is still 200: use completed assets and never resend the entire batch merely because failed is positive. Quota is reserved by count and refunded only for failures the server determines refundable. Disconnects, submission_unknown, and storage failures after delivery may remain billed; neither assets.length nor failed proves the final debit. Check authenticated quota after uncertainty.
Response · application/json
{
"data": {
"assets": [
{
"id": "asset-example",
"kind": "image",
"mime": "image/png",
"bytes": 1024,
"width": 2048,
"height": 2048,
"durationMs": null,
"url": "/api/v1/media/assets/asset-example",
"title": null,
"origin": "generated",
"createdAt": 1800000000000,
"expiresAt": null,
"attribution": null
}
],
"failed": 1,
"errors": [
{
"code": "submission_unknown",
"message": "Submission may be billed"
}
],
"model": "public-image-model",
"latencyMs": 1000
}
}Media generation
Submit once, save the job id, then read the existing task.
prompt is required (factory maximum 2000). Defaults: mode=description, duration=5 seconds (integer 4–12), aspectRatio=16:9 (also 9:16 or 1:1), resolution=720p (also 480p or 1080p), watermark=false, cameraFixed=false. Choose options from the selected live model descriptor. A 202 response may already contain a failed job: inspect status/error and save data.job.id immediately. There are no completion webhooks or global idempotency keys.
keyframe requires firstFrameUrl; lastFrameUrl is allowed only if the model supports it, and referenceImageUrls must be absent. reference uses referenceImageUrls with a product maximum of 8, often lower by model. description normally has no images; its compatibility form accepts up to two referenceImageUrls and normalizes them to keyframes. Explicit firstFrameUrl/lastFrameUrl in description is rejected. Gateway reference images require sides 300–6000px and aspect ratio 0.4–2.5.
Related operations: get-job
POST/api/v1/media/videos/generations
Authentication: key-or-sessionSuccess status: 202
| Field | Type | Description |
|---|---|---|
| promptRequired | string | Nonempty prompt; factory maximum 2000 characters. |
| modelOptional | string | Public model id from live discovery; empty examples must be replaced.ai_video.limits.models[].id |
| modeOptional | string | description, keyframe or reference; subject to model limits.description |
| durationOptional | integer | Integer seconds 4–12; use selected model limits.5 |
| aspectRatioOptional | string | 16:9, 9:16 or 1:1, subject to model support.16:9 |
| resolutionOptional | string | 480p, 720p or 1080p, subject to model support.720p |
| watermarkOptional | boolean | Whether the selected model applies a watermark.false |
| cameraFixedOptional | boolean | Requires selected model support.false |
| firstFrameUrlOptional | string | Required only in keyframe mode. |
| lastFrameUrlOptional | string | Optional keyframe tail if supported. |
| referenceImageUrlsOptional | string[] | Reference images; product maximum 8, model may allow fewer. |
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/media/videos/generations"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
payload=$(cat <<'ARAGON_JSON'
{
"prompt": "A calm lake at sunrise",
"duration": 5,
"aspectRatio": "16:9",
"resolution": "720p"
}
ARAGON_JSON
)
status=$(curl --silent --show-error --max-time 600 -X POST "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "$payload" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 202) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)Set the runtime variables before running. Refuse redirects and preserve errors.
Response · application/json
{
"data": {
"job": {
"id": "job-example",
"capability": "ai_video",
"status": "queued",
"phase": "queued",
"model": "public-video-model",
"params": {
"prompt": "A calm lake at sunrise",
"promptChars": 22,
"duration": 5,
"resolution": "720p",
"aspectRatio": "16:9",
"mode": "description"
},
"error": null,
"asset": null,
"createdAt": 1800000000000,
"updatedAt": 1800000000000,
"finishedAt": null,
"deadlineAt": 1800007200000
}
}
}Media generation
Receive a protected MP3 asset or consume audio bytes.
text is required, factory maximum 1000 characters; use live limits.maxChars. Choose voice from defaultVoice or voices[].id. speed defaults to 1; recommended 0.5–2. The adapter accepts finite 0.1–3 and clamps to 0.5–2, while values outside 0.1–3 are invalid. response=url (default) returns data.asset, voice and durationMs; response=stream returns audio/mpeg. No format selector is provided: output is MP3. A failure before streaming may be JSON; check HTTP and MIME before writing bytes. Streaming ends after at most 300 seconds and normal EOF cannot prove semantic audio completeness.
POST/api/v1/media/audio/speech
Authentication: key-or-sessionSuccess status: 200
| Field | Type | Description |
|---|---|---|
| textRequired | string | Nonempty text, limited by live maxChars.tts.limits.maxChars |
| voiceOptional | string | String id from voices[].id or defaultVoice.tts.limits.voices[].id |
| speedOptional | number | Recommended 0.5–2; finite 0.1–3 accepted and clamped.1 |
| responseOptional | string | url returns JSON; stream returns audio/mpeg.url |
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/media/audio/speech"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
payload=$(cat <<'ARAGON_JSON'
{
"text": "Hello, world",
"response": "url"
}
ARAGON_JSON
)
status=$(curl --silent --show-error --max-time 600 -X POST "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "$payload" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)Set the runtime variables before running. Refuse redirects and preserve errors.
Response · application/json | audio/mpeg
{
"data": {
"asset": {
"id": "asset-example",
"kind": "audio",
"mime": "audio/mpeg",
"bytes": 1024,
"width": null,
"height": null,
"durationMs": 1500,
"url": "/api/v1/media/assets/asset-example",
"title": null,
"origin": "generated",
"createdAt": 1800000000000,
"expiresAt": null,
"attribution": null
},
"voice": "discovered-voice",
"durationMs": 1500
}
}Download bytes
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/media/audio/speech"
work=$(mktemp -d "./.aragon-download.XXXXXXXX")
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
payload=$(cat <<'ARAGON_JSON'
{
"text": "Hello, world",
"response": "stream"
}
ARAGON_JSON
)
status=$(curl --silent --show-error --max-time 600 -X POST "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "$payload" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in audio/mpeg) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
mv "$work/body" 'aragon-output.mp3'
printf '%s\n' 'aragon-output.mp3'
# Normal EOF cannot prove semantic audio completeness.
)Check HTTP and MIME before publishing the complete file; preserve an existing target on failure.
Response · application/json | audio/mpeg
Download bytes · audio/mpegAsset search
Find images, preserve attribution, and use opaque pagination.
Send query (1–200 characters) and optional perPage (default 20, factory maximum 30). orientation is landscape, portrait or squarish; color/orderBy follow live limits. Items contain id, description, width, height, color, thumbUrl, previewUrl, downloadUrl, author, pageUrl and optional downloadLocation. Keep attribution and original downloadLocation when saving Unsplash material.
Search returns data.items,total,hasMore,nextCursor,attribution. Resend nextCursor unchanged with the same query and filters; do not parse it or invent a page number. A disabled upstream can invalidate a cursor (400 invalid_cursor): restart from the first page. Preserve service and author attribution. External downloadUrl requests must not inherit gateway credentials.
POST/api/v1/media/search/images
Authentication: key-or-sessionSuccess status: 200
| Field | Type | Description |
|---|---|---|
| queryRequired | string | Nonempty search query, maximum 200 characters. |
| perPageOptional | integer | Default 20; maximum depends on capability limits.20 |
| cursorOptional | string | Opaque nextCursor, resent unchanged with original filters. |
| orientationOptional | string | Choose orientation from this capability limits.image_search.limits |
| colorOptional | string | Choose supported filter values from live limits.image_search.limits |
| orderByOptional | string | Choose supported filter values from live limits.image_search.limits |
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/media/search/images"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
payload=$(cat <<'ARAGON_JSON'
{
"query": "ocean",
"perPage": 3
}
ARAGON_JSON
)
status=$(curl --silent --show-error --max-time 600 -X POST "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "$payload" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)Set the runtime variables before running. Refuse redirects and preserve errors.
Response · application/json
{
"data": {
"items": [
{
"id": "search-example",
"author": {
"name": "Example author",
"url": "https://example.com/author"
},
"pageUrl": "https://example.com/item",
"downloadUrl": "https://example.com/file",
"description": "Ocean",
"width": 2048,
"height": 1365,
"color": "#005577",
"thumbUrl": "https://example.com/thumb",
"previewUrl": "https://example.com/preview",
"downloadLocation": "https://api.unsplash.com/photos/example/download"
}
],
"total": 1,
"hasMore": false,
"nextCursor": null,
"attribution": {
"source": "example",
"text": "Example author / Example source",
"url": "https://example.com/item"
}
}
}Asset search
Find video previews and download locations.
query is required (maximum 200); perPage defaults to 20 with factory maximum 80. orientation is landscape, portrait or mixed. Items contain id, width, height, durationMs, thumbUrl, previewUrl, downloadUrl, author and pageUrl. Search does not save items into your asset library.
Search returns data.items,total,hasMore,nextCursor,attribution. Resend nextCursor unchanged with the same query and filters; do not parse it or invent a page number. A disabled upstream can invalidate a cursor (400 invalid_cursor): restart from the first page. Preserve service and author attribution. External downloadUrl requests must not inherit gateway credentials.
POST/api/v1/media/search/videos
Authentication: key-or-sessionSuccess status: 200
| Field | Type | Description |
|---|---|---|
| queryRequired | string | Nonempty search query, maximum 200 characters. |
| perPageOptional | integer | Default 20; maximum depends on capability limits.20 |
| cursorOptional | string | Opaque nextCursor, resent unchanged with original filters. |
| orientationOptional | string | Choose orientation from this capability limits.video_search.limits |
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/media/search/videos"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
payload=$(cat <<'ARAGON_JSON'
{
"query": "ocean",
"perPage": 3
}
ARAGON_JSON
)
status=$(curl --silent --show-error --max-time 600 -X POST "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "$payload" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)Set the runtime variables before running. Refuse redirects and preserve errors.
Response · application/json
{
"data": {
"items": [
{
"id": "search-example",
"author": {
"name": "Example author",
"url": "https://example.com/author"
},
"pageUrl": "https://example.com/item",
"downloadUrl": "https://example.com/file",
"width": 1920,
"height": 1080,
"durationMs": 12000,
"thumbUrl": "https://example.com/thumb",
"previewUrl": "https://example.com/preview.mp4"
}
],
"total": 1,
"hasMore": false,
"nextCursor": null,
"attribution": {
"source": "example",
"text": "Example author / Example source",
"url": "https://example.com/item"
}
}
}Asset search
Find preview-quality audio with its author and license.
query is required (maximum 200); perPage defaults to 20 with factory maximum 150. Discover audioType, sort, minDurationSeconds and maxDurationSeconds in limits. Items contain id, name, description, durationMs, tags, license, author, previewUrl, downloadUrl, pageUrl and optional waveformUrl, sizeBytes, channels and sampleRate. These are previews; OAuth original-quality downloads are not promised.
Search returns data.items,total,hasMore,nextCursor,attribution. Resend nextCursor unchanged with the same query and filters; do not parse it or invent a page number. A disabled upstream can invalidate a cursor (400 invalid_cursor): restart from the first page. Preserve service and author attribution. External downloadUrl requests must not inherit gateway credentials.
POST/api/v1/media/search/sounds
Authentication: key-or-sessionSuccess status: 200
| Field | Type | Description |
|---|---|---|
| queryRequired | string | Nonempty search query, maximum 200 characters. |
| perPageOptional | integer | Default 20; maximum depends on capability limits.20 |
| cursorOptional | string | Opaque nextCursor, resent unchanged with original filters. |
| audioTypeOptional | string | Choose supported filter values from live limits.audio_search.limits |
| sortOptional | string | Choose supported filter values from live limits.audio_search.limits |
| minDurationSecondsOptional | number | Choose supported filter values from live limits.audio_search.limits |
| maxDurationSecondsOptional | number | Choose supported filter values from live limits.audio_search.limits |
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/media/search/sounds"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
payload=$(cat <<'ARAGON_JSON'
{
"query": "ocean",
"perPage": 3
}
ARAGON_JSON
)
status=$(curl --silent --show-error --max-time 600 -X POST "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "$payload" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)Set the runtime variables before running. Refuse redirects and preserve errors.
Response · application/json
{
"data": {
"items": [
{
"id": "search-example",
"author": {
"name": "Example author",
"url": "https://example.com/author"
},
"pageUrl": "https://example.com/item",
"downloadUrl": "https://example.com/file",
"name": "Ocean waves",
"description": "Waves",
"durationMs": 5000,
"tags": [
"ocean"
],
"license": "CC0",
"previewUrl": "https://example.com/preview.mp3",
"waveformUrl": "https://example.com/waveform",
"sizeBytes": 80000,
"channels": 2,
"sampleRate": 44100
}
],
"total": 1,
"hasMore": false,
"nextCursor": null,
"attribution": {
"source": "example",
"text": "Example author / Example source",
"url": "https://example.com/item"
}
}
}Workflows
Bound polling by the task deadline and retry reads only.
Queued/running are live; succeeded/failed/expired/cancelled are terminal. phase is presentation progress, not a terminal state. Poll with ARAGON_JOB_ID separately from generation. Require a valid epoch-millisecond deadlineAt; use min(deadlineAt+60s, start+121min). Begin at 2 seconds, increasing to 10. Before every request and wait, recompute remaining budget; GET timeout is at most 30 seconds and remaining time. An earlier deadline tightens the budget. Missing deadline stops with the saved id.
Stop on 401/403/404 and other nonrecoverable 4xx. For 429 honor valid Retry-After seconds or HTTP-date, default 10 seconds, within the total budget. Retry only GET after network failures or 502/503/504, stopping after 5 consecutive failures; valid responses reset that count. Always retain the job id on errors, timeout or interruption. succeeded with asset=null means no asset currently available; do not regenerate automatically.
Cancel returns 202 with data.job, upstreamStillRunning:true and notice. Cancellation is local: upstream work and billing may continue, quota is not refunded. Cancelling a terminal task returns 409 job_already_finished. A task error is distinct from HTTP failure and stops automatic polling.
GET/api/v1/media/jobs/{id}
Authentication: key-or-sessionSuccess status: 200
| Field | Type | Description |
|---|---|---|
| idRequired | path string | Opaque resource id, encoded as one URL path segment. |
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
command -v jq >/dev/null || { echo "Requires jq >=1.6" >&2; exit 2; }
: "${ARAGON_JOB_ID:?Set ARAGON_JOB_ID}"
case "$ARAGON_JOB_ID" in .|..) exit 2 ;; esac
resource_id=$(printf "%s" "$ARAGON_JOB_ID" | jq -sRr @uri)
path='/api/v1/media/jobs/'
url="$ORIGIN/api/v1/media/jobs/$resource_id"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
status=$(curl --silent --show-error --max-time 600 -X GET "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)Queued/running are live; succeeded/failed/expired/cancelled are terminal. phase is presentation progress, not a terminal state. Poll with ARAGON_JOB_ID separately from generation. Require a valid epoch-millisecond deadlineAt; use min(deadlineAt+60s, start+121min). Begin at 2 seconds, increasing to 10. Before every request and wait, recompute remaining budget; GET timeout is at most 30 seconds and remaining time. An earlier deadline tightens the budget. Missing deadline stops with the saved id.
Response · application/json
{
"data": {
"job": {
"id": "job-example",
"capability": "ai_video",
"status": "queued",
"phase": "queued",
"model": "public-video-model",
"params": {
"prompt": "A calm lake at sunrise",
"promptChars": 22,
"duration": 5,
"resolution": "720p",
"aspectRatio": "16:9",
"mode": "description"
},
"error": null,
"asset": null,
"createdAt": 1800000000000,
"updatedAt": 1800000000000,
"finishedAt": null,
"deadlineAt": 1800007200000
}
}
}Read-only job polling
# POSIX shell + curl + jq >=1.6; read only. No new generation is submitted.
(
set -eu
command -v jq >/dev/null || { echo "Requires jq >=1.6" >&2; exit 2; }
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
: "${ARAGON_JOB_ID:?Set ARAGON_JOB_ID from the earlier submit response}"
case "$ARAGON_JOB_ID" in .|..) exit 2 ;; esac
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
id=$(printf "%s" "$ARAGON_JOB_ID" | jq -sRr @uri)
url="$ORIGIN/api/v1/media/jobs/$id"
work=$(mktemp -d)
trap 'printf "ARAGON_JOB_ID=%s\n" "$ARAGON_JOB_ID" >&2; rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
deadline=$(jq -nr 'now + 121 * 60'); gap=2; failures=0
remaining() { jq -nr --argjson deadline "$deadline" '$deadline-now'; }
wait_poll() {
jq -ne --argjson wait "$1" --argjson remaining "$(remaining)" '$wait < $remaining' >/dev/null || exit 1
sleep "$1"
}
while :; do
budget=$(remaining)
jq -ne --argjson budget "$budget" '$budget>0' >/dev/null || exit 1
timeout=$(jq -nr --argjson budget "$budget" '[$budget,30]|min')
if status=$(curl --silent --show-error --max-time "$timeout" -X GET "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" --dump-header "$work/headers" \
--output "$work/body" --write-out "%{http_code}"); then :; else status=000; fi
jq -ne --argjson budget "$(remaining)" '$budget>0' >/dev/null || exit 1
case "$status" in
429)
failures=0
retry=$(awk 'tolower($1)=="retry-after:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1)
delay=$(jq -nr --arg value "$retry" 'if ($value|test("^[0-9]+$")) then
($value|tonumber) else (try (($value|strptime("%a, %d %b %Y %H:%M:%S GMT")
|mktime)-now | [.,0]|max) catch 10) end')
wait_poll "$delay"; continue ;;
000|502|503|504)
failures=$((failures+1)); [ "$failures" -lt 5 ] || exit 1
wait_poll "$gap"; continue ;;
200) ;;
*) cat "$work/body" >&2; exit 1 ;;
esac
grep -Ei '^content-type:[[:space:]]*application/json' "$work/headers" >/dev/null || exit 1
jq -e '.data.job.deadlineAt | type=="number" and .>0' "$work/body" >/dev/null || exit 1
failures=0
deadline=$(jq -r --argjson previous "$deadline" \
'[.data.job.deadlineAt/1000+60,$previous]|min' "$work/body")
state=$(jq -r '.data.job.status' "$work/body")
if jq -e '.data.job.error != null' "$work/body" >/dev/null; then
cat "$work/body"; break
fi
case "$state" in
succeeded|failed|expired|cancelled) cat "$work/body"; break ;;
queued|running) ;;
*) echo "Unknown job status" >&2; exit 1 ;;
esac
wait_poll "$gap"; gap=$((gap+2)); [ "$gap" -le 10 ] || gap=10
done
)Stop on 401/403/404 and other nonrecoverable 4xx. For 429 honor valid Retry-After seconds or HTTP-date, default 10 seconds, within the total budget. Retry only GET after network failures or 502/503/504, stopping after 5 consecutive failures; valid responses reset that count. Always retain the job id on errors, timeout or interruption. succeeded with asset=null means no asset currently available; do not regenerate automatically.
Response · application/json
{
"data": {
"job": {
"id": "job-example",
"capability": "ai_video",
"status": "succeeded",
"phase": "ready",
"model": "public-video-model",
"params": {
"prompt": "A calm lake at sunrise",
"promptChars": 22,
"duration": 5,
"resolution": "720p",
"aspectRatio": "16:9",
"mode": "description"
},
"error": null,
"asset": {
"id": "asset-example",
"kind": "video",
"mime": "video/mp4",
"bytes": 1024,
"width": 2048,
"height": 2048,
"durationMs": null,
"url": "/api/v1/media/assets/asset-example",
"title": null,
"origin": "generated",
"createdAt": 1800000000000,
"expiresAt": null,
"attribution": null
},
"createdAt": 1800000000000,
"updatedAt": 1800000000000,
"finishedAt": 1800000010000,
"deadlineAt": 1800007200000
}
}
}POST/api/v1/media/jobs/{id}/cancel
Authentication: key-or-sessionSuccess status: 202
| Field | Type | Description |
|---|---|---|
| idRequired | path string | Opaque resource id, encoded as one URL path segment. |
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
command -v jq >/dev/null || { echo "Requires jq >=1.6" >&2; exit 2; }
: "${ARAGON_JOB_ID:?Set ARAGON_JOB_ID}"
case "$ARAGON_JOB_ID" in .|..) exit 2 ;; esac
resource_id=$(printf "%s" "$ARAGON_JOB_ID" | jq -sRr @uri)
path='/api/v1/media/jobs//cancel'
url="$ORIGIN/api/v1/media/jobs/$resource_id/cancel"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
status=$(curl --silent --show-error --max-time 600 -X POST "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 202) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)Cancel returns 202 with data.job, upstreamStillRunning:true and notice. Cancellation is local: upstream work and billing may continue, quota is not refunded. Cancelling a terminal task returns 409 job_already_finished. A task error is distinct from HTTP failure and stops automatic polling.
Response · application/json
{
"data": {
"job": {
"id": "job-example",
"capability": "ai_video",
"status": "cancelled",
"phase": "queued",
"model": "public-video-model",
"params": {
"prompt": "A calm lake at sunrise",
"promptChars": 22,
"duration": 5,
"resolution": "720p",
"aspectRatio": "16:9",
"mode": "description"
},
"error": null,
"asset": null,
"createdAt": 1800000000000,
"updatedAt": 1800000000000,
"finishedAt": null,
"deadlineAt": 1800007200000
},
"upstreamStillRunning": true,
"notice": "Upstream work and billing may continue"
}
}Workflows
Protected gateway paths return bytes, not JSON.
Asset URLs are relative protected paths, not public sharing links. Resolve against the chosen origin, require exactly that origin, no userinfo/query/hash and one encoded nonempty id after /api/v1/media/assets/. Send the gateway key only there and refuse redirects. GET supports Range (206), If-None-Match (304 reuses a local copy) and 416 (correct the range); the basic example requires 200. DELETE returns 204 with no body; authorized repeat deletion is 204. Explicit deletion immediately reclaims files with no remaining references.
GET/api/v1/media/assets/{id}
Authentication: key-or-sessionSuccess status: 200 / 206 / 304
| Field | Type | Description |
|---|---|---|
| idRequired | path string | Opaque resource id, encoded as one URL path segment. |
Download bytes
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
command -v jq >/dev/null || { echo "Requires jq >=1.6" >&2; exit 2; }
: "${ARAGON_ASSET_ID:?Set ARAGON_ASSET_ID}"
case "$ARAGON_ASSET_ID" in .|..) exit 2 ;; esac
resource_id=$(printf "%s" "$ARAGON_ASSET_ID" | jq -sRr @uri)
path='/api/v1/media/assets/'
url="$ORIGIN/api/v1/media/assets/$resource_id"
work=$(mktemp -d "./.aragon-download.XXXXXXXX")
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
status=$(curl --silent --show-error --max-time 600 -X GET "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 200) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in image/png|image/jpeg|image/webp|image/gif|video/mp4|video/webm|audio/mpeg|audio/wav|audio/ogg) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
mv "$work/body" 'aragon-asset.bin'
printf '%s\n' 'aragon-asset.bin'
# Normal EOF cannot prove semantic audio completeness.
)Asset URLs are relative protected paths, not public sharing links. Resolve against the chosen origin, require exactly that origin, no userinfo/query/hash and one encoded nonempty id after /api/v1/media/assets/. Send the gateway key only there and refuse redirects. GET supports Range (206), If-None-Match (304 reuses a local copy) and 416 (correct the range); the basic example requires 200. DELETE returns 204 with no body; authorized repeat deletion is 204. Explicit deletion immediately reclaims files with no remaining references.
Check HTTP and MIME before publishing the complete file; preserve an existing target on failure.
Response · image/* | video/* | audio/*
Download bytes · image/png / image/jpeg / image/webp / image/gif / video/mp4 / video/webm / audio/mpeg / audio/wav / audio/oggDELETE/api/v1/media/assets/{id}
Authentication: key-or-sessionSuccess status: 204
| Field | Type | Description |
|---|---|---|
| idRequired | path string | Opaque resource id, encoded as one URL path segment. |
Empty response
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
command -v jq >/dev/null || { echo "Requires jq >=1.6" >&2; exit 2; }
: "${ARAGON_ASSET_ID:?Set ARAGON_ASSET_ID}"
case "$ARAGON_ASSET_ID" in .|..) exit 2 ;; esac
resource_id=$(printf "%s" "$ARAGON_ASSET_ID" | jq -sRr @uri)
path='/api/v1/media/assets/'
url="$ORIGIN/api/v1/media/assets/$resource_id"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
status=$(curl --silent --show-error --max-time 600 -X DELETE "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 204) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
printf "HTTP 204\n"
)Asset URLs are relative protected paths, not public sharing links. Resolve against the chosen origin, require exactly that origin, no userinfo/query/hash and one encoded nonempty id after /api/v1/media/assets/. Send the gateway key only there and refuse redirects. GET supports Range (206), If-None-Match (304 reuses a local copy) and 416 (correct the range); the basic example requires 200. DELETE returns 204 with no body; authorized repeat deletion is 204. Explicit deletion immediately reclaims files with no remaining references.
Response · empty
Empty responseWorkflows
Save allowed CDN results with real attribution.
sourceUrl is required, trimmed maximum 2048, and must belong to a CDN allowed by an enabled search upstream; this is not a general URL downloader. Pass attribution.text and attribution.url from the result. text is cleaned, trimmed and truncated to 200; url must be http(s), maximum 512. Attribution is recommended, not server-required. source is inferred by the server. There is no title parameter: asset title comes from cleaned attribution.text or null. Forward original downloadLocation for Unsplash download accounting; never fabricate it.
A successful save returns 201 with data.asset and consumes one additional unit of the matching search capability, separate from the search call. Saving shares generation concurrency slots: save serially to reduce 429 responses.
POST/api/v1/media/ingest
Authentication: key-or-sessionSuccess status: 201
| Field | Type | Description |
|---|---|---|
| sourceUrlRequired | string | Allowed search CDN URL, trimmed maximum 2048 characters. |
| attributionOptional | {text?:string,url?:string} | Recommended real source attribution; text≤200, http(s) url≤512. |
| downloadLocationOptional | string | Original Unsplash downloadLocation, never fabricated. |
JSON request
# POSIX shell; curl. Resource-id requests additionally require jq >=1.6.
(
set -eu
ORIGIN='https://skillrouter.net'
: "${ARAGON_API_KEY:?Set ARAGON_API_KEY}"
printf "%s" "$ORIGIN" | LC_ALL=C grep -Eq '^https?://([A-Za-z0-9.-]+|\[[0-9A-Fa-f:.]+\])(:[0-9]{1,5})?$' || exit 2
url="$ORIGIN/api/v1/media/ingest"
work=$(mktemp -d)
trap 'rm -f "$work/body" "$work/headers"; rmdir "$work"' EXIT HUP INT TERM
payload=$(cat <<'ARAGON_JSON'
{
"sourceUrl": "https://images.unsplash.com/photo-example",
"attribution": {
"text": "Example author / Unsplash",
"url": "https://unsplash.com/@example"
},
"downloadLocation": "https://api.unsplash.com/photos/example/download"
}
ARAGON_JSON
)
status=$(curl --silent --show-error --max-time 600 -X POST "$url" \
-H "Authorization: Bearer $ARAGON_API_KEY" \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "$payload" \
--dump-header "$work/headers" --output "$work/body" --write-out "%{http_code}")
case "$status" in 201) ;;
*) cat "$work/body" >&2; printf "\nHTTP %s\n" "$status" >&2; exit 1 ;; esac
mime=$(awk 'tolower($1)=="content-type:" {$1=""; sub(/^ /, ""); print}' "$work/headers" | tr -d "\r" | tail -n 1 | cut -d ";" -f 1)
case "$mime" in application/json) ;; *) echo "Unexpected Content-Type" >&2; exit 1 ;; esac
cat "$work/body"
)Set the runtime variables before running. Refuse redirects and preserve errors.
Response · application/json
{
"data": {
"asset": {
"id": "asset-example",
"kind": "image",
"mime": "image/png",
"bytes": 1024,
"width": 2048,
"height": 2048,
"durationMs": null,
"url": "/api/v1/media/assets/asset-example",
"title": null,
"origin": "ingest",
"createdAt": 1800000000000,
"expiresAt": null,
"attribution": {
"source": "unsplash",
"text": "Example author / Unsplash",
"url": "https://unsplash.com/@example"
}
}
}
}Workflows
Preserve uncertainty and avoid duplicate paid submissions.
quota contains unit,dailyLimit,used,remaining,resetsAt. dailyLimit=0 and remaining=null mean unlimited. Quota resets at UTC midnight; display resetsAt in local time. Images count per image, videos per video, TTS per thousand JS string characters rounded up, search per call. Changing your own key does not bypass account quota. LLM errors and media errors have different envelopes; media errors carry error.code/message and sometimes field; internal_error can also occur.
Disable SDK/client automatic retries. Model/capability discovery, job GET and asset GET allow bounded retries. Search consumes quota: retry only after an explicitly recoverable rejection. Never blindly resend generation after a timeout, disconnect, 502/504 or submission_unknown; it may already be billed. Preserve request/job information, ask the user when another paid action is needed. Ordinary requests use a 600-second client timeout; requests timeout limits connect/read waits rather than an exact total wall clock. Stopping the local connection does not cancel upstream billing.
- 400 · invalid_request
- Correct message/field; do not repeat unchanged input.
- 400 · text_too_long
- Split according to live maxChars; each synthesis is metered.
- 400 · invalid_cursor
- Discard the cursor and restart the original search.
- 400 · no_credential
- Administrator probe only: configure a credential.
- 400 · confirm_required
- Administrator live test only: billing confirmation is required.
- 401 · authentication_error
- Check your gateway key and account status.
- 403 · capability_disabled
- Contact the administrator; repeated calls cannot enable this capability.
- 403 · tier_denied
- Ask the administrator to grant your account tier access.
- 404 · not_found
- Stop reading: missing, expired or unauthorized; never enumerate ids.
- 409 · job_already_finished
- Read the job and handle its existing terminal state.
- 409 · scope_changed
- Administrator quota scope changed; refresh before modifying.
- 409 · conflict
- Administrator configuration conflict; refresh and correct it.
- 413 · request_too_large
- Reduce JSON or inline-image size.
- 413 · asset_too_large
- Choose a smaller asset or output.
- 413 · storage_quota_exceeded
- Delete your unneeded assets or contact the administrator.
- 415 · unsupported_media
- Use a supported image, audio or video format.
- 422 · content_rejected
- Revise user content; never resubmit automatically.
- 429 · quota_exceeded
- Wait until quota.resetsAt or request an increased limit.
- 429 · too_many_inflight
- Wait for current work, then honor Retry-After.
- 429 · too_many_jobs
- Wait for existing video jobs to finish and retain their ids.
- 429 · upstream_rate_limited
- Honor Retry-After; generate again only after a confirmed pre-submission rejection.
- 429 · probe_throttled
- Administrator probe only: wait for Retry-After.
- 502 · upstream_unavailable
- The body carries retryable: true when the request never left the gateway (nothing was billed) and false when the provider already answered. Bounded read retries are allowed; never repeat uncertain generation.
- 502 · invalid_provider_response
- Preserve request/job information and contact the administrator.
- 503 · capability_not_configured
- Contact the administrator; this is not a client parameter error.
- 503 · capability_unavailable
- Refresh discovery and avoid frequent retries.
- 503 · egress_unavailable
- The body carries retryable: true when no request was handed to the tunnel. Contact the administrator about gateway egress.
- 504 · upstream_timeout
- Generation may be submitted; query the saved job, do not resubmit.
- job · submission_unknown
- Retain the job id; submission and billing may have occurred. Stop polling this failed task.
- job · upstream_generation_failed
- Report the generation failure; let the user decide whether to create again.
- job · upstream_task_expired
- The upstream task expired; retain the id and report the terminal result.
- job · local_deadline_exceeded
- The gateway stopped waiting at its deadline; preserve the task information.
- job · asset_download_failed
- The generated result could not be stored; never fabricate an asset URL.
- job · invalid_provider_response
- The upstream task result was unreadable; retain the error and id.
Agent integration
Install reusable knowledge and a private project connection in one step.
Open /console/install, choose Codex, Claude Code, Cursor or Generic, then generate and copy the instructions to your agent. The short-lived ticket creates a dedicated personal key; the installer verifies public artifacts and writes the skill, reference, runtime and project connection. Use --upgrade for verified unchanged earlier versions. Modified or unknown files are preserved as conflicts. Use --replace-credentials only for an explicit connection replacement. Installation runs discovery without paid generation. Generic agents must explicitly read SKILL.md.
connection.json schemaVersion 2 contains only public metadata, a fixed credentialsFile path and skill/reference/runtime/gitignore SHA-256 hashes. The private .local/credentials.json stores the baseUrl and personal key together. scripts/aragon.mjs reads this pair automatically, independent of cwd, and ignores conflicting environment variables. Corrupt private configuration fails closed. Secrets and recovery files are protected and Git-ignored; Windows requires native ACL support. Revoke connections on the Install page or in My credentials. Legacy installs without the local runtime may keep using ARAGON_BASE_URL and ARAGON_API_KEY, or upgrade from /console/install.