Dragon
dragon · Everyday coding
$1.00 in / $6.00 out per 1M
SWE-bench: 76.2% Verified / 50.9% Pro
[ API documentation ]
Everything you need to drop the MWS gateway into your stack. If something here is unclear, email support@vellora.ai.
All endpoints live under:
https://api.mws.run/v1Every request needs a Bearer token in the Authorization header. Generate one in the dashboard after you've added at least $10 in credits or subscribed to a plan.
Authorization: Bearer <your-api-key>POST /v1/messages: Anthropic Messages format (recommended for new code).POST /v1/messages/count_tokens: Approximate token count where enabled (rough estimate; Anthropic-equivalent tokenizer not used).POST /v1/chat/completions: OpenAI Chat Completions format. Streaming and tool-use supported.GET /v1/models: List available Dragon profiles.POST /v1/embeddings: Embedding generation.POST /v1/rerank: Document reranking.Set stream: true. Anthropic-shape responses use Anthropic's SSE event types (message_start, content_block_delta, etc.). OpenAI-shape responses use standard data: {...}\\n\\n chunks terminated by [DONE].
const stream = client.messages.stream({
model: "claude-sonnet-4-6",
max_tokens: 1024,
messages: [{ role: "user", content: "Stream me a poem." }],
});
for await (const event of stream) {
if (event.type === "content_block_delta" && event.delta.type === "text_delta") {
process.stdout.write(event.delta.text);
}
}Both API shapes support function/tool calling. IDs are preserved verbatim across turns, so the standard request → tool_use → tool_result → end_turn flow works unchanged from the underlying SDK.
const tools = [
{
name: "get_weather",
description: "Look up the weather for a city.",
input_schema: {
type: "object",
properties: { city: { type: "string" } },
required: ["city"],
},
},
];
const first = await client.messages.create({
model: "claude-sonnet-4-6",
max_tokens: 512,
tools,
messages: [{ role: "user", content: "What's the weather in Paris?" }],
});
// first.stop_reason === "tool_use"
// Reply with a tool_result and call again to get the final answer.Pass a Claude model name (claude-sonnet-4-6, claude-haiku-4, claude-opus-4) or pass a Dragon profile slug directly. Unknown model strings default to Dragon.
dragon · Everyday coding
$1.00 in / $6.00 out per 1M
SWE-bench: 76.2% Verified / 50.9% Pro
tiny · Lightweight tasks (/tiny)
$0.1667 in / $0.50 out per 1M
large · Harder everyday tasks (/large)
$1.5833 in / $6.6667 out per 1M
SWE-bench: 78.2% Verified / 58.6% Pro
max · Hardest tasks (/max)
$2.00 in / $6.2857 out per 1M
SWE-bench: — Verified / 62.1% Pro
400: Invalid request body (e.g. missing max_tokens, malformed tool schema).401: Missing, invalid, or revoked API key.402: Out of credits or quota. Top up at /dashboard/credits.429: Rate limit exceeded (per-key limit, or per-IP for unauthenticated traffic). Check Retry-After.5xx: Upstream provider unavailable. Retry with backoff.Rate limits apply per key. A fresh key starts at roughly 8 requests per second with a short burst ceiling above that. When you hit the limit, the response is 429 with a Retry-After header: back off and retry.
cache_control markers are accepted but not honored as-is; the gateway manages its own caching. You never need to set them.messages.count_tokens uses a 4-char-per-token estimate. Treat as approximate.baseURL: "https://api.mws.run/v1" on your Anthropic client.baseURL: "https://api.mws.run/v1" on your OpenAI client.model: "gpt-4o" to model: "dragon" (or another profile). Models like gpt-4o route to Dragon by default.