Skip to main content
Inference.net uses more than one credential type because the platform supports both direct hosted inference and observability-proxy workflows.

Which key do I use?

Key typeUse it forWhere it is used
Inference API keyDirect calls to the hosted Inference.net API and deployed model endpointsAuthorization: Bearer ...
Observability project API keyRequests routed through Observex-inference-observability-api-key
CLI authLocal CLI usage and codebase instrumentationinf 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
Inference.net still accepts 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
For CI or headless environments, use:
  • INF_API_KEY
  • inf auth set-key
See /cli/overview for the full CLI auth flow.

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