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.

POST/v1/chat/completionsOpenAI Chat Completions
POST/v1/messagesAnthropic Messages
POST/v1/messages/count_tokensToken estimate (for Claude Code)
GET/v1/modelsModels and prices

Models

Model IDContextInput / MCached input / MOutput / M
deepseek-v4.1-flash-uncensored1M tokens$0.12$0.015$0.525
deepseek-v4.1-flash1M 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

Prices are in USD per million tokens and may change before general availability. Both models list at the same price whichever provider serves the call.

These are reasoning models

They think before they answer, and that thinking counts toward 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

POST/v1/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."}
    ]
  }'

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_tokens is 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

POST/v1/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.

Terminal
export ANTHROPIC_BASE_URL="https://swarmcomputers.com"
export ANTHROPIC_AUTH_TOKEN="$API_KEY"
export ANTHROPIC_MODEL="deepseek-v4.1-flash"
claude

List models

GET/v1/models

Returns every model with its context length and price.

Response
{
  "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_tokens answer. If it can't, you get 402 insufficient_credits and 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.