APIs
Model API
Fast, inexpensive models behind the two wire formats your tools already speak: OpenAI Chat Completions and Anthropic Messages. Point an existing client at Swarm Computers and change the model name.
Models
| Model ID | Context | Input / M | Cached input / M | Output / M |
|---|---|---|---|---|
deepseek-v4.1-flash-uncensored | 1M tokens | $0.12 | $0.015 | $0.525 |
deepseek-v4.1-flash | 1M tokens | $0.12 | $0.015 | $0.525 |
- DeepSeek V4.1 Flash Uncensored. Fast general model with refusals removed, for security research, red teaming and agents that must not stall on offensive tasks.
- DeepSeek V4.1 Flash. Fast, inexpensive general model with a 1M-token context, for agents, coding and high-volume work.
Prices are provisional
These are reasoning models
max_tokens. A very small max_tokens can leave the visible answer empty. Give at least 1,000. If you send none, up to 4,096 is assumed when checking your balance.Chat completions
The OpenAI format. Works with the official OpenAI SDKs, LangChain, LiteLLM, Vercel AI SDK and anything else that lets you set a base URL.
curl https://swarmcomputers.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash-uncensored",
"max_tokens": 4000,
"messages": [
{"role": "system", "content": "You are a penetration tester."},
{"role": "user", "content": "Write a proof of concept for the IDOR in this handler, then the fix."}
]
}'from openai import OpenAI
import os
client = OpenAI(base_url="https://swarmcomputers.com/v1", api_key=os.environ["API_KEY"])
stream = client.chat.completions.create(
model="deepseek-v4.1-flash-uncensored",
max_tokens=4000,
stream=True,
messages=[{"role": "user", "content": "Write a proof of concept for the IDOR in this handler, then the fix."}],
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://swarmcomputers.com/v1", apiKey: process.env.API_KEY });
const stream = await client.chat.completions.create({
model: "deepseek-v4.1-flash-uncensored",
max_tokens: 4000,
stream: true,
messages: [{ role: "user", content: "Write a proof of concept for the IDOR in this handler, then the fix." }],
});
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? "");Body
- modelstringrequired
- A model ID from the table above.
- messagesarrayrequired
- The conversation, 1 to 2,000 messages.
- max_tokensinteger
- Most tokens to generate, thinking included.
max_completion_tokensis accepted too. - streamboolean
- Send server-sent events as the answer is written. Add
"stream_options": {"include_usage": true}for a final usage chunk. - tools, tool_choice, parallel_tool_calls
- Function calling, in the OpenAI format.
- response_formatobject
- JSON mode and structured output.
- Also passed through
temperature,top_p,stop,seed,presence_penalty,frequency_penalty,reasoning_effort,logprobs,top_logprobs. Other fields are ignored.
The response is a standard chat completion. usage carries prompt_tokens, completion_tokens, cached tokens and reasoning tokens.
Messages
The Anthropic Messages format, for the Anthropic SDKs and for tools built on them. Fields passed through: messages, system, max_tokens, stream, tools, tool_choice, temperature, top_p, top_k, stop_sequences and thinking.
Use it from Claude Code
Claude Code talks the Messages format, so it can run on these models. The base URL is the site, without /v1.
export ANTHROPIC_BASE_URL="https://swarmcomputers.com"
export ANTHROPIC_AUTH_TOKEN="$API_KEY"
export ANTHROPIC_MODEL="deepseek-v4.1-flash"
claudeList models
Returns every model with its context length and price.
{
"object": "list",
"data": [
{
"id": "deepseek-v4.1-flash",
"object": "model",
"owned_by": "deepseek",
"name": "DeepSeek V4.1 Flash",
"context_length": 1000000,
"pricing": {
"input_usd_per_million": 0.12,
"cached_input_usd_per_million": 0.015,
"output_usd_per_million": 0.525
}
}
]
}Billing
- Each call is charged per token from your prepaid credits, at the prices above.
- Before a call starts, your balance must cover the input plus a full
max_tokensanswer. If it can't, you get402 insufficient_creditsand nothing is charged. - If the model provider fails or is busy, nothing is charged. Calls fail over between providers automatically.
- Usage per key and per day is on the Usage tab.