Which key do I use?
| Key type | Use it for | Where it is used |
|---|---|---|
| Inference API key | Direct calls to the hosted Inference.net API and deployed model endpoints | Authorization: Bearer ... |
| Observability project API key | Requests routed through Observe | x-inference-observability-api-key |
| CLI auth | Local CLI usage and codebase instrumentation | inf auth login or INF_API_KEY |
Direct API key
Use the direct API key when you are calling the Inference.net API itself.- best for /quickstart
- sent as
Authorization: Bearer ... - used for direct serverless inference and deployment-specific API usage
Observability project API key
Use the observability project API key when you are routing traffic through Observe.- sent as
x-inference-observability-api-key - associates each request with the correct project
- typically starts with
sk-observability- - not interchangeable with the direct API key
x-inference-project-api-key for backwards compatibility, but new integrations should use x-inference-observability-api-key.
CLI authentication
For the CLI, prefer browser-based login for local development:inf auth login
INF_API_KEYinf auth set-key
Common mistakes
- Using a direct API key in
x-inference-observability-api-key - Using an observability project key as the bearer token for the direct API
- Forgetting to keep the upstream provider’s own auth in place when using Observe