Your First API Call
The basic Shannon workflow is simple: submit a task, get a task ID, check the status, and retrieve the result.Complete Example (cURL)
Common API Patterns
1. Submit → Poll → Retrieve
The standard workflow for any task:2. Multi-Turn Conversations (Sessions)
Use the samesession_id to maintain context across multiple tasks:
3. Real-Time Streaming (SSE)
Get live updates instead of polling:4. Error Handling
Always handle errors gracefully:Authentication Setup
Getting Your API Key
1
Development Mode (Skip Auth)
For local testing, you can disable authentication:Then use any placeholder key:
2
Production Mode (Real API Keys)
Generate an API key from your Shannon dashboard:
- Log in to Shannon Cloud
- Navigate to Settings → API Keys
- Click “Create API Key”
- Copy the key (starts with
sk_)
Including the API Key
Always include your API key in theX-API-Key header:
Complete Workflow Example
Here’s a real-world example that combines all patterns:Next Steps
Now that you know the basics, explore more advanced features:Full API Reference
Complete documentation for all endpoints
Agents Catalog
Pre-built agents for specific tasks
Python SDK
Official Python client library
Streaming API
Real-time event streaming with SSE
Common Questions
How do I know when my task is complete?
How do I know when my task is complete?
Poll the
GET /api/v1/tasks/{id} endpoint until status is TASK_STATUS_COMPLETED or TASK_STATUS_FAILED. For long-running tasks, use streaming instead of polling.What's the difference between result and response?
What's the difference between result and response?
resultis the raw text output from the LLMresponseis only present ifresultcontains valid JSON (parsed automatically)
result.How long do sessions last?
How long do sessions last?
Sessions persist for 30 days by default. All tasks with the same
session_id share conversation history.Can I cancel a running task?
Can I cancel a running task?
Yes, use
POST /api/v1/tasks/{id}/cancel. The task will stop at the next safe checkpoint.Why use streaming instead of polling?
Why use streaming instead of polling?
Streaming provides real-time updates with lower latency and less server load. Use it for long-running tasks or when you need immediate feedback.
Troubleshooting
401 Unauthorized
- Check your API key is correct
- Verify you’re using the
X-API-Keyheader (notAuthorization) - In dev mode, ensure
GATEWAY_SKIP_AUTH=1is set
429 Rate Limited
- Check the
Retry-Afterheader - Implement exponential backoff
- Upgrade your API tier for higher limits
Task stuck in RUNNING
- Wait longer (complex tasks take time)
- Use streaming to see progress
- Check Temporal UI for detailed workflow status
Empty result field
- Task might still be running (check
status) - Task failed (check
errorfield) - Use streaming to see intermediate output