by 0G Foundation
The model that remembers. 0GM-2.0 is 0G’s first model with built-in memory: it stores your conversation history inside the model, up to 120M tokens per account, and recalls it across sessions, quoting the original messages instead of a summary. It topped all 10 of our long-context benchmarks. Text in / text out, 262K context and up to 65K output per request. Function calling supported; thinking is on by default and can be turned off.
262K
262,144 tokens
66K
65,535 tokens
$2
per 1M tokens
$12
per 1M tokens
$3
per 1M tokens · 30 days · reads free
curl "https://router-api.0g.ai/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-d '{
"model": "0gm-2.0",
"messages": [
{"role": "user", "content": "Hello!"}
],
"stream": true
}'0GM-2.0 keeps memory across sessions. Memory is billed separately from inference: you pay to store it, and reading it back is free.
| Item | Price | When it's charged |
|---|---|---|
| Memory write | $3 / 1M new tokens | Once per compact / save. Includes the first 30 days of retention. |
| Memory renewal | $3 / 1M tokens / 30 days | Prorated by actual time. Any model use within 30 days renews to a full 30 days. |
| Memory retrieval | Free | Included in inference. |
Provider Routing
Control which provider handles your request using the X-0G-Provider-* request headers.
X-0G-Provider-Address pins a provider; X-0G-Provider-Identity pins which of its upstreams to route through — both values come from the address and provider_identity fields of GET /v1/providers. Together they address one specific upstream of one provider. Send neither and the router picks by price and health, exactly as before.
curl "https://router-api.0g.ai/v1/chat/completions" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-H "X-0G-Provider-Address: <PROVIDER_ADDRESS>" \
-H "X-0G-Provider-Identity: <UPSTREAM>" \
-H "X-0G-Provider-Sort: latency" \
-H "X-0G-Provider-Allow-Fallbacks: true" \
-d '{
"model": "0gm-2.0",
"messages": [{"role": "user", "content": "Hello!"}]
}'