Documentation Index
Fetch the complete documentation index at: https://docs.eggapi.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
This guide uses the production API base URL:
1. Get an API Key
Sign in at eggapi.ai, open the dashboard, and create an API key. The public API only accepts API keys in the Authorization header:
Authorization: Bearer YOUR_API_KEY
2. Submit a Task
All currently documented public generation models are asynchronous. POST /v1/generate returns 202 Accepted and a task object.
curl -X POST https://api.eggapi.ai/v1/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nanobanana",
"prompt": "A cinematic product photo of a matte green travel mug",
"aspect_ratio": "16:9",
"num_outputs": 1,
"webhook_url": "https://webhook.site/your-webhook-id"
}'
Example response:
{
"data": {
"id": "gen_abc123def456",
"status": "pending",
"model": "nanobanana",
"type": "image_generate",
"cost": "$0.00",
"created_at": "2026-05-08T10:30:00Z"
},
"error": null
}
3. Poll the Task
Use the task ID from the response:
curl https://api.eggapi.ai/v1/tasks/gen_abc123def456 \
-H "Authorization: Bearer YOUR_API_KEY"
Completed task response:
{
"data": {
"id": "gen_abc123def456",
"status": "completed",
"model": "nanobanana",
"type": "image_generate",
"output": {
"url": "https://file.eggapi.ai/images/gen_abc123def456/0.png",
"urls": ["https://file.eggapi.ai/images/gen_abc123def456/0.png"]
},
"cost": "$0.0100",
"created_at": "2026-05-08T10:30:00Z",
"started_at": "2026-05-08T10:30:01Z",
"completed_at": "2026-05-08T10:30:12Z"
},
"error": null
}
4. Check Usage
Usage endpoints require an API key:
curl https://api.eggapi.ai/v1/usage/summary \
-H "Authorization: Bearer YOUR_API_KEY"
Example response:
{
"data": [
{
"model": "nanobanana",
"total_units": 1,
"total_cost": "$0.0100",
"request_count": 1
}
],
"error": null
}
Next Steps
Models
Choose the right model ID and parameters.
Async Tasks
Poll tasks, consume webhooks, and handle retries.