Documentation Index
Fetch the complete documentation index at: https://docs.airgraphic.io/llms.txt
Use this file to discover all available pages before exploring further.
1. Create a key
Open /app/api-keys, create a key, and store it as an environment variable.
# docs-example: set-api-key
export AIRGRAPHIC_API_KEY="ag_your_api_key"
2. Queue a generation
Send exactly one primary source. This example uses a URL.
# docs-example: generate-curl
curl -X POST "https://airgraphic.io/api/generate" \
-H "Authorization: Bearer $AIRGRAPHIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sourceUrl": "https://example.com/post",
"aspectRatio": "4:5",
"outputFormat": "png",
"outcome": "linkedin_carousel_slide"
}'
The response is immediate:
docs-example: queued-response
{
"jobId": "2e58e816-7f3d-4d8a-9adf-59ce26c7e3d1",
"status": "queued",
"falRequestId": "fal-request-id",
"stages": ["extract", "brief", "image"]
}
3. Poll the job
# docs-example: poll-curl
curl "https://airgraphic.io/api/jobs/2e58e816-7f3d-4d8a-9adf-59ce26c7e3d1" \
-H "Authorization: Bearer $AIRGRAPHIC_API_KEY"
When the job completes, use imageUrl.
docs-example: completed-job-response
{
"id": "2e58e816-7f3d-4d8a-9adf-59ce26c7e3d1",
"status": "completed",
"imageUrl": "https://jonexoyprmookskliicn.supabase.co/storage/v1/object/public/generations/example.png"
}
CLI
The local CLI uses the same API key.
# docs-example: cli-generate
AIRGRAPHIC_API_KEY="$AIRGRAPHIC_API_KEY" npm run airgraphic -- "https://example.com/post" --aspect 4:5 --json