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.
public demo key · get your own
ornith-1.5:9b, a model we keep loaded all the time, free, shared by everyone and rate-limited. When you want every model, your own limits and the Private switch, get your own key (one click with Discord, Google, GitHub or Twitch, with trial credit) and sign in: these snippets then fill in your key.Quickstart
- Get a key. Sign in at legit2compute.com/developers. Signing in with Discord, Google, GitHub or Twitch includes trial credit; an email sign-up starts at zero and tops up from the same page. Your key starts with
l2ck_. To try first, the snippets below already carry the public demo key. - Call a model. The gateway speaks the OpenAI chat API, so this is the whole integration:
export L2C_API_KEY=l2ck_demo_cc7af91fbc644562a91444be9c80ce81
curl https://api.legit2compute.com/nodes/llm/v1/chat/completions \
-H "Authorization: Bearer $L2C_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "ornith-1.5:9b", "messages": [{"role": "user", "content": "Say hello in five words."}]}'from openai import OpenAI
client = OpenAI(base_url="https://api.legit2compute.com/nodes/llm/v1", api_key="l2ck_demo_cc7af91fbc644562a91444be9c80ce81")
reply = client.chat.completions.create(
model="ornith-1.5:9b",
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/modelslists 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. For an agent that handles private data, switch on Private in your dashboard: your requests are then served only by machines we own and operate, never a community provider's or an outside service, at 1.5× the listed price. Every response says which tier served it in
X-L2C-Privacy. More on private models for agents. - 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 ID | Context | Takes images | $ / 1M in · out · cached | Now |
|---|---|---|---|---|
gemma4:12bGemma 4 12B (vision) |
128K | yes | $0.040 · $0.12 · $0.010 | on demand |
llama3.1Llama 3.1 8B |
128K | — | $0.030 · $0.050 · $0.008 | always on |
ornith-1.5:9bOrnith 1.5 9B (vision, 256K) |
256K | yes | $0.080 · $0.14 · $0.020 | always on |
ornith-1.5:35bOrnith 1.5 35B (vision, 256K) |
256K | yes | $0.12 · $0.80 · $0.050 | resident |
qwen3.8:27bQwen3.8 27B (vision + text) |
128K | yes | $0.15 · $1.80 · $0.030 | resident |
bonsai-2:9bBonsai 2 9B (vision) |
256K | yes | $0.064 · $0.10 · $0.032 | on demand |
deepseek-ocr:3bDeepSeek-OCR 3B |
128K | yes | $0.040 · $0.060 · $0.020 | on demand |
mimo-v2.6:9bMiMo-V2.6 9B (vision) |
256K | yes | $0.030 · $0.10 · $0.015 | on demand |
granite4.2:3bGranite 4.2 3B (text) |
128K | — | $0.040 · $0.060 · $0.020 | on demand |
granite4.2:8bGranite 4.2 8B (text) |
128K | — | $0.050 · $0.16 · $0.012 | on demand |
lfm3:1.7bLFM3 1.7B (text) |
256K | — | $0.040 · $0.060 · $0.020 | on demand |
Tool calling and at least 64K context, from the live catalog. Always on models are kept loaded, so they answer the first call straight away: the safest choice for an agent. Any other model that is not resident answers 503 with "warming": true for a minute or two while it starts.
Embeddings
For search, retrieval (RAG) and clustering: POST https://api.legit2compute.com/nodes/llm/v1/embeddings takes the OpenAI request, with input as a string or a list of strings, and returns one vector per input. Any OpenAI client's embeddings.create works unchanged. Embedding models are tagged embeddings on /models and bill input tokens only.
curl https://api.legit2compute.com/nodes/llm/v1/embeddings -H "x-api-key: $L2C_API_KEY" -H "Content-Type: application/json" \
-d '{"model": "qwen3-embedding:0.6b", "input": ["a red fox in the snow", "un renard roux dans la neige"]}'Use the same model to embed your documents and your queries: vectors from different models cannot be compared.
Rerank
After a vector search, a reranker reads the query beside each candidate and scores how well it answers, which puts the right passage first far more often than vector distance alone. POST https://api.legit2compute.com/nodes/llm/v1/rerank takes a query and a list of documents (Cohere and Jina shape) and returns each document's index and relevance_score, best first; top_n limits the list. Billed per input token.
curl https://api.legit2compute.com/nodes/llm/v1/rerank -H "x-api-key: $L2C_API_KEY" -H "Content-Type: application/json" \
-d '{"model": "qwen3-reranker:0.6b", "query": "How do I get an API key?",
"documents": ["Sign up with Discord, then copy your key.", "Foxes are omnivores.", "Credits never expire."],
"top_n": 2}'Speech to text
POST https://api.legit2compute.com/nodes/llm/v1/audio/transcriptions is OpenAI's transcription call: send the audio as a multipart upload (WAV, MP3, M4A and more, up to 25 MB) with the model, and optionally language. It answers {"text": …} and is billed per second of audio. Any OpenAI client's audio.transcriptions.create works with our base URL and a model ID from /models.
curl https://api.legit2compute.com/nodes/llm/v1/audio/transcriptions -H "x-api-key: $L2C_API_KEY" \ -F model=whisper-large-v3-turbo -F file=@interview.mp3
For long recordings, or captions burned into video, use the transcribe_only and clip pipelines in the job API instead: they take a URL and have no size limit.
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.
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"Private processing. Add "private": true to a job and it runs only on servers we own and operate, never on a community provider's machine or rented capacity. Use it for client or unreleased material. It is billed at a premium, currently twice the normal price, and the job's charge shows the multiple.
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. See what it makes: real Shorts, a song, a voiceover and an image an agent made with it.
Install it in one line. It goes into Claude Code's skills folder, and into Hermes Agent's and OpenClaw's if you have them; run it again any time to update:
curl -fsSL https://legit2compute.com/install-skill.sh | sh
irm https://legit2compute.com/install-skill.ps1 | iex
Or as a Claude Code plugin, from its GitHub repository:
/plugin marketplace add legit2click/legit2cloud-skill /plugin install legit2cloud@legit2cloud
Integration guides
Hermes Agent
by Nous ResearchThe self-improving terminal and messaging agent. Use our models as its custom provider and give it the media skill.
OpenClaw
by OpenClawThe personal assistant that lives in your chat apps. Add us as a provider in openclaw.json and install the media skill.
Odysseus
by odysseus-devThe self-hosted AI workspace. Add one model endpoint in Settings and every chat, agent and research run can use it.
MCP server
by Claude, Cursor, VS CodeOne URL and your key: any MCP client can ask our models and make images, music, voice and video.
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. Vendor-style IDs such as meta-llama/llama-3.1-8b-instruct resolve to the same models.