OpenAI-compatible API quickstart: Token Factory in 3 minutes
OpenAI-compatible API, no new SDK: swap one base URL in your OpenAI client and the code you already have runs on DeepSeek V4.1 Flash, MiniMax and Qwen, free until Dec 16.
packet.ai Team
November 24, 2026
An OpenAI-compatible API accepts the same requests as OpenAI's Chat Completions endpoint, so you can switch providers by changing the base URL and key. On packet.ai Token Factory that switch takes about 3 minutes, and tokens are free until December 16, 2026.
Key takeaways
Token Factory is packet.ai's OpenAI-compatible API for open-weight models.
Base URL: https://api.packet.ai/v1. The official OpenAI Python and Node.js SDKs work as they are.
Input and output tokens cost $0 until December 16, 2026.
Signup takes an email or Google account and one SMS code. No credit card.
Live models: DeepSeek V4.1 Flash, MiniMax M3.1 Flash and Qwen2.5-1.5B-Instruct. Kimi K3 is coming soon.
Streaming, JSON mode and tool calling use the same parameters as OpenAI.
If your code already calls OpenAI, you don't need a new SDK to try open-weight models. You need a key, a base URL and a model ID. This guide gets you from signup to a working request in about 3 minutes, then shows the same call in Python and Node.js.
An OpenAI-compatible API is an endpoint that accepts the same request and response format as OpenAI's Chat Completions API. The JSON body, the messages array, the Authorization: Bearer header and the response shape all match. Any client written for OpenAI can call it by pointing at a different base URL.
That's why so many providers offer one. Groq, OpenRouter, Mistral and Google Gemini all expose OpenAI-compatible endpoints, and so do self-hosted servers like vLLM. Switching between them means editing two config values. The rest of your code stays the same.
What packet.ai Token Factory's OpenAI-compatible API gives you
Token Factory is packet.ai's managed LLM inference API. You send a chat completion request, packet.ai runs the model on its own GPUs and counts the tokens. You don't provision an instance or tune a serving stack, and idle time costs nothing.
OpenAI-compatible API
Chat completions through the official OpenAI Python and Node.js SDKs. Change base_url and keep your code.
Streaming, JSON mode, tools
stream=True, response_format json_object and function calling through the tools parameter.
Open-weight models
DeepSeek V4.1 Flash, MiniMax M3.1 Flash and Qwen2.5-1.5B-Instruct on packet.ai GPUs.
It runs on the same NVIDIA B200, RTX PRO 6000 and A100 fleet that packet.ai rents by the hour. If you later want a dedicated endpoint, you can rent a B200 on packet.ai and serve the same model with vLLM, which exposes the same OpenAI-compatible routes.
Make your first API call in 3 minutes
There are four steps. Setup takes about 90 seconds and the request takes about 90 more.
1
Create your packet.ai account (30 sec)
Sign up at dash.packet.ai with an email address or a Google account. No card needed.
2
Verify your phone number (30 sec)
Enter the SMS code. Unverified accounts can't send requests.
3
Pick a model and create an API key (30 sec)
Copy a model ID from dash.packet.ai/serverless, create a key and save it as PACKET_API_KEY.
4
Send your first request (90 sec)
POST to https://api.packet.ai/v1/chat/completions with curl or the OpenAI SDK.
Step 1: Create your packet.ai account
Sign up at dash.packet.ai with an email address or a Google account. You won't be asked for a card.
Step 2: Verify your phone number
Enter the code sent by SMS. Requests from unverified accounts are rejected, so finish this before you create a key.
Note
If your first request returns 401 and the key looks right, check that phone verification went through.
Step 3: Pick a model and create an API key
Open the Serverless models page at dash.packet.ai/serverless, choose a model and copy its model ID. Then create an API key and save it as an environment variable. Keep it out of your source code and out of git.
Step 4: Send a request with curl
Paste this into a terminal with your key and the model ID from step 3:
Token Factory charges $0 per input and output token until December 16, 2026.
Switch from OpenAI to an OpenAI-compatible API in two lines
If you already use the OpenAI SDK, add base_url and swap the key. Everything else stays the same, which makes Token Factory a low-effort OpenAI API alternative for open-weight models.
Install the SDK with pip install openai, then run:
Python
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.packet.ai/v1",
api_key=os.environ["PACKET_API_KEY"],
)
resp = client.chat.completions.create(
model="DeepSeek-V4.1-Flash-NVFP4",
messages=[{"role": "user", "content": "Summarise this ticket in one line: login fails after password reset."}],
)
print(resp.choices[0].message.content)
Node.js (OpenAI SDK)
Install the SDK with npm install openai, then run:
JavaScript (Node.js)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.packet.ai/v1",
apiKey: process.env.PACKET_API_KEY,
});
const resp = await client.chat.completions.create({
model: "DeepSeek-V4.1-Flash-NVFP4",
messages: [{ role: "user", content: "Summarise this ticket in one line: login fails after password reset." }],
});
console.log(resp.choices[0].message.content);
Streaming, JSON mode and tool calling on Token Factory
All three use OpenAI's parameter names, so code that already uses them keeps working.
Streaming responses
Set stream=True to get tokens as they're generated. It helps in chat interfaces, where the first token matters more than the total time.
Python
stream = client.chat.completions.create(
model="DeepSeek-V4.1-Flash-NVFP4",
messages=[{"role": "user", "content": "List three uses for a 1.5B model."}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")
JSON mode
Set response_format to json_object when another program reads the output. Validate the result anyway.
Python
resp = client.chat.completions.create(
model="DeepSeek-V4.1-Flash-NVFP4",
response_format={"type": "json_object"},
messages=[{"role": "user", "content": "Return JSON with keys gpu and vram_gb for the B200."}],
)
Tool calling
Pass your functions in tools. The model replies with tool_calls for your code to run.
Python
tools = [{
"type": "function",
"function": {
"name": "get_gpu_price",
"description": "Get the hourly price of a GPU on packet.ai",
"parameters": {
"type": "object",
"properties": {"gpu": {"type": "string"}},
"required": ["gpu"],
},
},
}]
resp = client.chat.completions.create(
model="DeepSeek-V4.1-Flash-NVFP4",
messages=[{"role": "user", "content": "How much is a B200 per hour?"}],
tools=tools,
)
print(resp.choices[0].message.tool_calls)
Which open source LLM API model should you call first?
All three live models are free until December 16. After that the output price differs by up to 8.5×, so it's worth matching the model to the job now.
Prototypes and evals that need real request volume
Internal tools and side projects without a billing setup
Comparing DeepSeek, MiniMax and Qwen on the same prompt
Plan for change
Per-token pricing starts on December 16, 2026
The model list will change, so keep the model ID in config
No public rate limit is published yet, so check your dashboard
After the free period, Qwen2.5-1.5B-Instruct on Token Factory costs $0.10 per million input tokens and $0.10 per million output tokens.
How Token Factory compares to other free LLM APIs
Groq, OpenRouter and Google Gemini also offer free access through OpenAI-compatible endpoints. Most permanent free tiers cap requests per day. Token Factory charges nothing per token for a fixed period instead.
Provider
Free allowance
Card required
OpenAI-compatible base URL
packet.ai Token Factory
$0 for all tokens until Dec 16, 2026
No (phone verification)
https://api.packet.ai/v1
Groq
30 RPM, 1K requests/day, 200K tokens/day on gpt-oss-120b
No
https://api.groq.com/openai/v1
OpenRouter (:free models)
20 RPM, 50 requests/day (1,000 after buying 10 credits)
No
https://openrouter.ai/api/v1
Google Gemini API
Free tier on Flash models; limits shown in AI Studio
Groq's free tier allows 1,000 requests and 200,000 tokens a day on gpt-oss-120b. OpenRouter's free models allow 50 requests a day.
Pick Groq or Gemini if a permanent, rate-limited tier fits your workload. Pick Token Factory if you want to send real volume now and keep the same endpoint once you start paying. Competitor limits come from each provider's documentation as of October 2026 and change often.
Fix common errors on your first OpenAI-compatible API call
Error
Likely cause
Fix
401 Unauthorized
Missing or wrong key, or phone not verified
Check the Authorization: Bearer header and finish SMS verification
404 Not Found
Wrong path or model ID
Use https://api.packet.ai/v1/chat/completions and copy the model ID from dash.packet.ai/serverless
Connection or SSL error
Base URL typo or missing /v1
Set base_url to exactly https://api.packet.ai/v1
429 Too Many Requests
Rate limit on your key
Back off and retry with an exponential delay, or ask help@packet.ai for higher limits
400 Bad Request
Prompt too long or invalid JSON
Trim the prompt below the model's context window and validate the request body
Frequently asked questions
Yes, until December 16, 2026. Every input and output token on packet.ai Token Factory costs $0 until then, for new and existing accounts. After that date, input and output tokens are billed separately per million at each model's listed rate. Idle time is never charged.
No. You need an email address or Google account and a phone number that can receive one SMS code. Phone verification has to be done before your first request goes through. No card is collected during the free period, so you can test the API before you set up billing.
Yes. Token Factory follows the OpenAI Chat Completions format, so the official OpenAI Python and Node.js SDKs work without changes. Set base_url to https://api.packet.ai/v1, pass your packet.ai API key and use a Token Factory model ID. Streaming, JSON mode and tool calling take the same parameters as on OpenAI.
DeepSeek V4.1 Flash (NVFP4), MiniMax M3.1 Flash and Qwen2.5-1.5B-Instruct are live, and Kimi K3 is listed as coming soon. All of them run on packet.ai's own GPUs. The Serverless models page in the dashboard shows the current list, each model's context window and the exact model ID to use.
Your key, code and endpoint keep working. From December 16, 2026, tokens are billed per million: DeepSeek V4.1 Flash at $0.23 input and $0.85 output, MiniMax M3.1 Flash at $0.15 and $0.60, and Qwen2.5-1.5B-Instruct at $0.10 for both. Prices follow the market average for each model as of November 2026.
Yes. You can rent a B200, RTX PRO 6000 or A100 on packet.ai by the hour and serve the same model with vLLM. vLLM exposes the same OpenAI-compatible routes, so moving from Token Factory to your own GPU means changing the base URL again.