Forkline's API is OpenAI-compatible. Call any published model with one API key from the same endpoint. The second half covers building and publishing your own model.
https://forkline.ai/v1Three steps to your first call.
Send the API key as a Bearer token in the Authorization header. Calls are charged to the credits of the person who created the key.
Authorization: Bearer fk_...Call POST /v1/chat/completions. Requests and responses have the same shape as OpenAI's Chat Completions API.
POST/v1/chat/completions
curl https://forkline.ai/v1/chat/completions \
-H "Authorization: Bearer $FORKLINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "your-model",
"messages": [{"role": "user", "content": "Hello"}]
}'Replace your-model with the model ID shown in the store. Model IDs use lowercase letters, digits and hyphens.
Set stream: true to receive Server-Sent Events. The last chunk carries usage (token counts), followed by data: [DONE].
stream = client.chat.completions.create(
model="your-model",
messages=[{"role": "user", "content": "Hello"}],
stream=True,
)
for chunk in stream:
if chunk.choices:
print(chunk.choices[0].delta.content or "", end="")data: {"choices":[],"usage":{"prompt_tokens":12,"completion_tokens":48,"total_tokens":60}}
data: [DONE]
: cost_jpy=…GET /v1/models returns the models published in the store and your own models. id is the model ID.
GET/v1/models
curl https://forkline.ai/v1/models \
-H "Authorization: Bearer $FORKLINE_API_KEY"{
"object": "list",
"data": [
{ "id": "your-model", "object": "model", "created": 1793000000, "owned_by": "your-org" }
]
}You pay the price the model's creator sets. The creator pays for GPU time, so the listed price is all you pay.
X-Forkline-Cost-JPY: 0.0177A Nebius-hosted model's endpoint stops after 15 minutes without calls. A call to a stopped endpoint starts it and immediately returns 503 model_warming_up with a Retry-After header (30 seconds). Starting can take a few minutes.
HTTP/1.1 503 Service Unavailable
Retry-After: 30
{
"error": {
"message": "The model is starting up. Retry in about 30 seconds.",
"type": "model_warming_up",
"code": "model_warming_up"
}
}The OpenAI SDKs retry 503 responses on their own and honour Retry-After. Raise max_retries so the client waits through a cold start.
client = OpenAI(
base_url="https://forkline.ai/v1",
api_key=os.environ["FORKLINE_API_KEY"],
max_retries=10, # 503 + Retry-After
)Errors use the same shape as OpenAI's.
{
"error": {
"message": "Insufficient credits. Top up your balance to continue.",
"type": "insufficient_credits",
"code": "insufficient_credits"
}
}| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request | The request body is malformed (model and messages are required) |
| 401 | invalid_api_key | The API key is missing, malformed or revoked |
| 402 | insufficient_credits | The credit balance is too low |
| 403 | model_suspended | The model has been suspended by the operator |
| 404 | model_not_found | The model does not exist or is not published |
| 409 | model_not_deployed | The model has not been deployed to an endpoint yet |
| 429 | rate_limit_exceeded | Rate limit exceeded (600 requests per minute per API key) |
| 502 | upstream_error | The model failed to run |
| 503 | model_warming_up | The endpoint is starting. Wait for Retry-After seconds and retry |
| 503 | model_unavailable | The model is temporarily unavailable |
In the console, create a model under "Models" with "Fine-tune Nemotron" and follow these steps.
Write one conversation per line as JSON. role is system, user or assistant, and content is a non-empty string.
{"messages": [{"role": "system", "content": "You answer questions about our return policy."}, {"role": "user", "content": "How do I return an item?"}, {"role": "assistant", "content": "Send us your order number and …"}]}
{"messages": [{"role": "user", "content": "Who pays for return shipping?"}, {"role": "assistant", "content": "We do, if the item arrived damaged. …"}]}The defaults work for most datasets.
Each base model trains and serves on one GPU of the following type.
| Base model | Training | Serving |
|---|---|---|
| Nemotron 3 Nano 4BDefaultnvidia/NVIDIA-Nemotron-3-Nano-4B-BF16 | NVIDIA L40S | NVIDIA L40S |
| Nemotron 3.5 Lightning 30B-A3Bnvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16 | NVIDIA H200 | NVIDIA H100 |
GPU time for training and endpoints is deducted from the creator's credits.
Prices are set in yen, per model.