API
Change the base URL. Nothing else.The intelligence on the other end has no owner.
The gateway speaks the shape your client already speaks. What differs is behind it: an open validator set, public weights, and an attestation for every answer.
- Base URL
- https://inference.opgein.com/v1
- Version
- 2026-05-01
- Phase
- Phase 1 · Language surface
The drop-in
One line is different.Your code does not know it moved.
There is no key to request. Phase 1 runs a free public endpoint and counts its budget per gateway rather than per key, so a client that insists on an apiKey field may send any non-empty string.
import OpenAI from "openai"; // Kimi, Qwen and OGI all speak thisconst client = new OpenAI({ // was: https://api.moonshot.ai/v1 baseURL: "https://inference.opgein.com/v1", apiKey: process.env.OGI_API_KEY,});const completion = await client.chat.completions.create({ model: "ogi-language-1", messages: [ { role: "user", content: "Who owns the machines that think?" }, ],});console.log(completion.choices[0].message.content);Moonshot AIFour endpoints.Everything they report is defined in the codex.
One of them answers queries. The other three are the network describing itself: who is serving, what it has been asked, and what the chain has recorded.
POST/chat/completions
One query, answered by one validator.
Returns a chat.completion. With stream: true the same completion arrives as server-sent events, paced to the latency the response reports.
GET/models
The surface catalogue, serving and dark.
Every surface the codex specifies, each with its status, the phase that activates it, the tiers eligible to serve it and the checkpoint registered against it.
GET/network/status
Fleet, settlement and phase, as of the hour.
Validator counts by tier, stake, the current slot and epoch, the token's programs, and the roadmap phase the network is in.
GET/usage
The trailing window, bucketed by hour.
Requests, tokens, latency percentiles, the audit sample and what it found, broken down per surface.
Capability is split into surfaces.Each one is registered, or it is dark.
3 of 8 surfaces accept a request today. The rest are specified in the codex and listed here with the phase that activates them — a surface is never implied to exist before it does.
| Model | Status | Context | Max output | Tiers | Phase |
|---|---|---|---|---|---|
| ogi-language-1OGI Language 1 | active | 131,072 | 8,192 | standard, heavy, cluster | 1 |
| ogi-language-1-distillOGI Language 1 Distill | active | 32,768 | 4,096 | light, standard, heavy, cluster | 1 |
| ogi-vision-1OGI Vision 1 | canary | 32,768 | 4,096 | standard, heavy, cluster | 2 |
| ogi-multimodal-1OGI Multimodal 1 | planned | 65,536 | 4,096 | heavy, cluster | 2 |
| ogi-reasoning-1OGI Reasoning 1 | planned | 65,536 | 8,192 | heavy, cluster | 3 |
| ogi-memory-1OGI Memory 1 | planned | 131,072 | 2,048 | light, standard, heavy | 3 |
| ogi-manipulation-1OGI Manipulation 1 | planned | 16,384 | 1,024 | heavy, cluster | 4 |
| ogi-locomotion-1OGI Locomotion 1 | planned | 8,192 | 512 | heavy, cluster | 4 |
Tiers are hardware classes, not price plans: light (Single consumer GPU, 24GB+), standard (Single consumer/prosumer GPU, 32GB+), heavy (Single data-center GPU, 80GB), cluster (Multi-node, high-bandwidth interconnect). A surface is served only by the tiers that can hold it.
The envelope
Every answer says who produced it.Nothing here has to be taken on trust.
Alongside the OpenAI-shaped body, a completion carries the validator that ran the forward pass, the pool it was drawn from, the attestation it signed, and whether this query was one of the copies dispatched to a second validator for comparison.
- x-ogi-request-id
- One per request, echoed on every response and every error. Quote it and the job can be found.
- x-ogi-gateway
- Which gateway instance answered. Stable within the hour, so traces group.
- x-ogi-api-version
- The surface version you are pinned against. Currently 2026-05-01.
- x-ogi-settlement-chain
- Where the attestation lands. solana.
- x-ratelimit-*
- Limit, remaining and reset. Counted per gateway, not per key.
"ogi": { "validator": { "id": "val_8BT7oFy7KP5", "tier": "heavy" }, "routing": { "eligible_validators": 180 }, "attestation": { "signed_by_validator": true, "batched_on_chain": false, "settles_on": "solana" }, "audit": { "sample_rate": 0.03, "sampled": false }, "price": { "billed_to_caller": 0, "funded_by": "treasury" }}Settlement is touched once, at the end of the period, when attestations are batched on-chain and the validators that produced them are credited. That is why batched_on_chain is false while you are reading the response: the job is signed, not yet settled.
Refusals name their reason.A dark surface is not an outage.
Errors come back in the same envelope as answers, with a param pointing at the field that caused them.
| Code | Status | When |
|---|---|---|
| model_not_found | 404 | The id is not in the surface catalogue. |
| model_not_active | 400 | The surface is specified but dark. The body names the phase that activates it. |
| missing_required_parameter | 400 | model or messages absent. |
| invalid_type | 400 | A field is the wrong type. param names it. |
| value_out_of_range | 400 | max_tokens above the surface's ceiling, or temperature outside 0–2. |
| invalid_json | 400 | The body did not parse. |
| internal_error | 500 | Retry with the same request id attached. |