Use the Twill REST API to create tasks, poll for status, and automate workflows.
Get an API key
API requests use a workspace-scoped API key.
- Navigate to your workspace settings
- Go to the API Keys section
- Click Create API Key
- Give your key a descriptive name (e.g., “CI Pipeline”, “GitHub Actions”)
- Optionally set an expiration date
- Copy the key immediately - it will only be shown once
Use the API key
Send it in the Authorization header as a Bearer token.
curl https://twill.ai/api/v1/tasks \
-H "Authorization: Bearer $TWILL_API_KEY"
API key security
Never commit API keys to version control. Use environment variables or a
secrets manager.
- Rotate keys periodically
- Use separate keys for different environments (dev, staging, prod)
- Revoke keys immediately if compromised