Api Aisuite
nebius-token-factory-cookbookapi
Export
Run models on Nebius Token Factory (via aisuite API)
References and Acknowledgements
Pre requisites
- Nebius API key. Sign up for free at Token Factory
- And complete the setup
1 - Install Dependencies
[1]
2 - Load Configuration
[2]
NOT running in Colab ✅ NEBIUS_API_KEY found
3 - Pick a Model
- Go to models tab in tokenfactory.nebius.com
- Copy the model name. For example
openai/gpt-oss-20b-Instruct-2507

4 - Run the Model
[3]
----model answer -----
The capital of France is Paris.
----- full response ----
{
"id": "chatcmpl-ee7a8e79ac83447686508087cde32c70",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
"content": "The capital of France is Paris.",
"refusal": null,
"role": "assistant",
"annotations": null,
"audio": null,
"function_call": null,
"tool_calls": [],
"reasoning_content": null
},
"stop_reason": null,
"token_ids": null
}
],
"created": 1762231897,
"model": "openai/gpt-oss-20b-Instruct-2507",
"object": "chat.completion",
"service_tier": null,
"system_fingerprint": null,
"usage": {
"completion_tokens": 8,
"prompt_tokens": 26,
"total_tokens": 34,
"completion_tokens_details": null,
"prompt_tokens_details": null
},
"prompt_logprobs": null,
"prompt_token_ids": null,
"kv_transfer_params": null
}
---------
CPU times: user 752 ms, sys: 310 ms, total: 1.06 s
Wall time: 5.64 s
5 - Try Your Queries
Go ahead and experiment with your queries. Here are some to get you started.
Write python code to read a csv file
write a haiku about cats