Developer docs

Build on legit2compute

One API key for open language and vision models, and for rendering images, video, music, voice and sound effects on the network. Point any OpenAI client at us, or plug us into the agent you already run.

Base URL (OpenAI-compatible)
https://api.legit2compute.com/nodes/llm/v1
API key
l2ck_… from /developers
Recommended model
qwen3.8:27b
Context window
131,072 tokens
Sign in and the snippets on this page fill in your own key.

Quickstart

  1. Get a key. Sign in at legit2compute.com/developers. Signing in with Discord includes trial credit; an email sign-up starts at zero and tops up from the same page. Your key starts with l2ck_.
  2. Call a model. The gateway speaks the OpenAI chat API, so this is the whole integration:
shell
export L2C_API_KEY=l2ck_...
curl https://api.legit2compute.com/nodes/llm/v1/chat/completions \
  -H "Authorization: Bearer $L2C_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "qwen3.8:27b", "messages": [{"role": "user", "content": "Say hello in five words."}]}'
python
from openai import OpenAI

client = OpenAI(base_url="https://api.legit2compute.com/nodes/llm/v1", api_key="l2ck_...")
reply = client.chat.completions.create(
    model="qwen3.8:27b",
    messages=[{"role": "user", "content": "Say hello in five words."}],
)
print(reply.choices[0].message.content)

Language models

  • Models. GET https://api.legit2compute.com/nodes/llm/v1/models lists every model your key can call, with its context window, tool support and price. The same list with live availability is on /models.
  • Auto. Send "model": "l2c/auto" and each request is served by the cheapest loaded model that fits it. For agents, name a model instead: an agent loop wants the same model on every turn.
  • Tools, vision, streaming, JSON mode work the OpenAI way. Reasoning is off unless you ask for it with "reasoning_effort".
  • Billing. Per token, from your credit (1 credit = $0.01). Repeated prompt prefixes (an agent's system prompt and tool list) bill at the cached rate, which is what keeps agent loops cheap.
  • Privacy. We record metadata only (model, token counts, latency, status). Prompts and outputs are not stored.
  • Hostname. Older guides and configs use wni.legit2compute.com. It is the same API and keeps working; there is nothing to change.

Models that suit agents

Model IDContextTakes images$ / 1M in · out · cachedNow
llama3.1
Llama 3.1 8B
128K— $0.016 · $0.032 · $0.008 resident
ornith-1.5:9b
Ornith 1.5 9B (vision, 256K)
256Kyes $0.050 · $0.080 · $0.020 resident
ornith-1.5:35b
Ornith 1.5 35B (vision, 256K)
256Kyes $0.18 · $0.30 · $0.050 on demand
qwen3.8:27b
Qwen3.8 27B (vision + text)
128Kyes $0.12 · $1.50 · $0.030 resident
llama3.1:70b
Llama 3.1 70B
128K— $0.32 · $0.32 · $0.10 on demand
deepseek-ocr:3b
DeepSeek-OCR 3B
128Kyes $0.040 · $0.060 · $0.020 on demand
granite4.1:3b
Granite 4.1 3B (text)
128K— $0.040 · $0.060 · $0.020 on demand

Tool calling and at least 64K context, from the live catalog. A model that is not resident answers 503 with "warming": true for a minute or two while it starts; the resident ones answer straight away.

Media generation

Images, image edits, image-to-video, text-to-video, music, voiceovers and sound effects are jobs: submit, poll, download, with the same key. Every endpoint is in the API reference.

shell
curl https://api.legit2compute.com/jobs -H "x-api-key: $L2C_API_KEY" -H "Content-Type: application/json" \
  -d '{"pipeline": "image_generate", "inputData": {"prompt": "a lighthouse at dawn, watercolor"}}'
# then GET https://api.legit2compute.com/jobs/<job_id> until "completed", and download (it redirects to the file, hence -L):
curl -L -o out.png https://api.legit2compute.com/jobs/<job_id>/download -H "x-api-key: $L2C_API_KEY"

The agent skill

The legit2cloud skill teaches an agent the whole platform: which pipeline makes what, how to submit, wait and download, and how to call the models. It is a standard SKILL.md folder with a dependency-free Python CLI, so it works in Claude Code, Hermes Agent, OpenClaw and anything else that reads Agent Skills. It needs Python 3.8+ and L2C_API_KEY in the environment.

Integration guides

Anything else that takes an OpenAI-compatible base URL works the same way: base URL https://api.legit2compute.com/nodes/llm/v1, your l2ck_ key, a model ID from the table above.