If you already use OpenAI, Anthropic, or another provider and want observability on top of that traffic, start with /start-here/observe-quickstart instead.
1. Get an API key
- Visit inference.net and create an account.
-
On the dashboard, visit the
API Keystab on the left sidebar. Create an API key or use the default key. - Copy the API key to your clipboard by clicking the copy icon to the right of the key.
-
In your terminal, set the
INFERENCE_API_KEYenvironment variable to the API key you copied.
2. Send a test request
Use a simplecurl request to confirm your key works and the API is reachable.
3. Use the OpenAI SDK
Inference.net is compatible with the OpenAI Chat API. You can use the official OpenAI SDK to interact with the Inference.net API. We support both streaming and non-streaming requests, as well as common parameters such as:max_tokenstemperaturetop_pfrequency_penaltypresence_penalty
Make sure you export the
INFERENCE_API_KEY environment variable before running the examples below.Next Steps
API Overview
Learn how the direct API fits into the broader platform and when to use background or batch paths.
Observe an existing app
Route traffic from another provider through Inference.net for tracing, analytics, datasets, and eval inputs.
Batch Processing
Process large asynchronous workloads offline when a user is not waiting for the answer.
View Models
Explore the models available on Inference.net