Documentation Index
Fetch the complete documentation index at: https://docs.tokenfactory.nebius.com/llms.txt
Use this file to discover all available pages before exploring further.
For the following example to work, save your API key to the NEBIUS_API_KEY environment variable.
Upload a file: POST
Request:
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.tokenfactory.nebius.com/v1/",
api_key=os.environ.get("NEBIUS_API_KEY"),
)
batch_requests = client.files.create(
file=open("batch-requests.jsonl", "rb"),
purpose="batch"
)
{
"id": "file-123",
"object": "file",
"bytes": 120000,
"created_at": 1730723658,
"filename": "batch-requests.jsonl",
"purpose": "batch"
}
Get file info: GET
Request:
client.files.retrieve("file-123")
{
"id": "file-123",
"object": "file",
"bytes": 120000,
"created_at": 1730723658,
"filename": "batch-requests.jsonl",
"purpose": "batch"
}
Get file content: GET
Request:
batch_result = client.files.content("file-123")
print(batch_result.text)
List files: GET
Request:
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.tokenfactory.nebius.com/v1/",
api_key=os.environ.get("NEBIUS_API_KEY"),
)
client.files.list()
{
"data": [
{
"id": "file-123",
"object": "file",
"bytes": 120000,
"created_at": 1730723658,
"filename": "batch-requests.jsonl",
"purpose": "batch"
},
{
"id": "file-789",
"object": "file",
"bytes": 120,
"created_at": 1731493853,
"filename": "health-records-batch.jsonl",
"purpose": "batch"
}
],
"object": "list"
}
Delete a file: DELETE
Request:
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.tokenfactory.nebius.com/v1/",
api_key=os.environ.get("NEBIUS_API_KEY"),
)
client.files.delete("file_123")
{
"id": "batch_123",
"object": "file",
"deleted": true
}
For detailed field descriptions, see the API reference.