"}`
5. Save the `apiKey` from the response — store it in a `.env` file or the project's secrets configuration
6. Confirm to the user that their account is set up and show them the quickstart example
Your user gets **\$5 in free API credits** upon signup. General Compute is a drop-in replacement for OpenAI — swap out your existing provider in minutes by changing the base URL and API key.
Ready to switch your opencode session to General Compute? Follow the step-by-step guide to configure your auth and start using General Compute models.
# API Keys & Base URLs
Source: https://docs.generalcompute.com/api-keys
Create and manage GeneralCompute API keys with the correct base URLs for each environment.
## Create an API key
1. Visit [generalcompute.com](https://generalcompute.com) and open the dashboard.
2. Generate a new key from **Developers → API keys**.
3. Copy the key once it is revealed — you will not be able to view it again.
Store the key as an environment variable so every SDK and CLI can pick it up automatically:
```bash theme={null}
export GENERALCOMPUTE_API_KEY=gc_live_your_api_key
```
Pass the key directly when necessary:
```typescript Node.js theme={null}
const client = new GeneralCompute({
apiKey: process.env.GENERALCOMPUTE_API_KEY,
});
```
```python Python theme={null}
import os
client = GeneralCompute(api_key=os.getenv("GENERALCOMPUTE_API_KEY"))
```
## Base URLs & OpenAI clients
GeneralCompute speaks the exact same dialect as OpenAI. Point any OpenAI-compatible SDK at the domains below:
| Environment | Base URL | Region |
| ------------ | -------------------------------- | ----------- |
| Production | `https://api.generalcompute.com` | `us-west-2` |
| Local router | `http://localhost:3000` | Local |
Override the base URL when instantiating the `openai` package (or any compatible SDK). That’s the only change needed besides swapping your API key:
```typescript Node.js theme={null}
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.GENERALCOMPUTE_API_KEY,
baseURL: "https://api.generalcompute.com/v1",
});
```
```python Python theme={null}
from openai import OpenAI
import os
client = OpenAI(
api_key=os.getenv("GENERALCOMPUTE_API_KEY"),
base_url="https://api.generalcompute.com/v1",
)
```
## Rotate and scope keys
* Create individual keys per service or environment so you can revoke them without affecting other workloads.
* Rotate long-lived keys on a schedule and update the associated secrets in CI/CD.
* Remove unused keys from the dashboard to minimize blast radius.
## Enterprise SLAs
Enterprise plans include uptime SLAs, named support, and optional dedicated deployments in additional AWS regions. Reach out to [support@generalcompute.com](mailto:support@generalcompute.com) to provision custom environments or higher-rate limits.
# Chat Completions
Source: https://docs.generalcompute.com/api-reference/endpoints/chat-completions
POST /v1/chat/completions
OpenAI-compatible chat completion endpoint with streaming support.
Create chat completions with streaming, tool calls, and JSON mode using the fully OpenAI-compatible payload.
# Models List
Source: https://docs.generalcompute.com/api-reference/endpoints/models-list
POST /v1/models/list
Returns the list of active models associated with the organization.
Return every model that is enabled for your organization, including private custom checkpoints.
# Public Models
Source: https://docs.generalcompute.com/api-reference/endpoints/public-models
GET /v1/public/models
Public endpoint that returns the metadata for the models surfaced in docs and pricing pages.
Fetch the metadata that powers the public models list without authentication.
# GeneralCompute API
Source: https://docs.generalcompute.com/api-reference/introduction
Reference for the OpenAI-compatible GeneralCompute API surface.
The GeneralCompute API mirrors the OpenAI platform while adding routing, observability, and ultra-low-latency infrastructure. All SDKs (OpenAI, Vercel AI SDK, LangChain, LlamaIndex, or the official GeneralCompute clients) interact with the same schema documented here.
## OpenAPI specification
This reference uses the live OpenAPI document exported from the router. It includes every available path, schema, and security definition:
View the exact schema that powers the API playground.
Key endpoints today:
| Path | Description |
| --------------------------- | ----------------------------------------------------- |
| `POST /v1/chat/completions` | Create chat completions with optional streaming |
| `POST /v1/models/list` | List models available to your organization |
| `GET /v1/public/models` | Fetch the curated list of public models shown in docs |
### POST /v1/chat/completions
Create chat completions with optional streaming. The body mirrors OpenAI’s schema, including tool calling and JSON mode fields.
```bash theme={null}
curl https://api.generalcompute.com/v1/chat/completions \
-H "Authorization: Bearer $GENERALCOMPUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax-m2.7",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Summarize this paragraph"}
],
"stream": false
}'
```
Streaming uses the same payload with `"stream": true` and returns `chat.completion.chunk` events over `text/event-stream`.
### POST /v1/models/list
Returns the models enabled for your org (including private checkpoints). Use this instead of OpenAI’s `GET /v1/models`.
```bash theme={null}
curl https://api.generalcompute.com/v1/models/list \
-H "Authorization: Bearer $GENERALCOMPUTE_API_KEY"
```
Each object contains `id`, `created`, and ownership metadata so you can dynamically populate dropdowns or perform health checks.
### GET /v1/public/models
Unauthenticated endpoint that powers the [Models & Pricing](/models) page.
```bash theme={null}
curl https://api.generalcompute.com/v1/public/models
```
Use this feed to keep your marketing site synchronized with the live catalog or to build in-product selectors that don’t rely on secrets.
## Authentication
All requests require a bearer token generated in the dashboard. Set the `Authorization` header to `Bearer ` and target the correct base URL for your environment. See [API Keys & Base URLs](/api-keys) for details.
The schema exposes the `ApiKeyAuth` security scheme, so Mintlify's API Explorer will automatically prompt you for a key.
# Node.js Streaming Chat
Source: https://docs.generalcompute.com/examples/node-streaming
Build a streaming CLI chat app with General Compute and Node.js — no framework needed.
Build a complete streaming chat in the terminal using just Node.js and the General Compute SDK. No frameworks, no build tools.
Clone the full example project:
```bash theme={null}
git clone https://github.com/generalcompute/docs
cd docs/examples/node-streaming
npm install
```
## 1. Set up the project
```bash theme={null}
mkdir my-chat && cd my-chat
npm init -y
npm install @generalcompute/sdk
```
## 2. Write the chat loop
This creates a multi-turn chat that streams responses token-by-token:
```typescript index.ts theme={null}
import GeneralCompute from "@generalcompute/sdk";
import * as readline from "readline";
const client = new GeneralCompute();
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
const messages: { role: "system" | "user" | "assistant"; content: string }[] = [
{ role: "system", content: "You are a helpful assistant." },
];
async function chat(userMessage: string) {
messages.push({ role: "user", content: userMessage });
const stream = await client.chat.completions.create({
model: "minimax-m2.7",
messages,
stream: true,
});
let assistantMessage = "";
process.stdout.write("\nAssistant: ");
for await (const chunk of stream) {
const content = chunk.choices[0]?.delta?.content;
if (content) {
process.stdout.write(content);
assistantMessage += content;
}
}
console.log("\n");
messages.push({ role: "assistant", content: assistantMessage });
}
function prompt() {
rl.question("You: ", async (input) => {
if (input.toLowerCase() === "exit") {
rl.close();
return;
}
await chat(input);
prompt();
});
}
console.log('Chat with General Compute (type "exit" to quit)\n');
prompt();
```
We're using `minimax-m2.7` — our best general-purpose model. For complex reasoning tasks, try `deepseek-v3.2`. See all models on the [Models & Pricing](/models) page.
## 3. Add your API key
```bash theme={null}
export GENERALCOMPUTE_API_KEY=gc_your_api_key_here
```
## 4. Run it
```bash theme={null}
npx tsx index.ts
```
You'll get an interactive chat in your terminal with streaming responses:
```
Chat with General Compute (type "exit" to quit)
You: What is General Compute?
```
# Vercel AI SDK Chat
Source: https://docs.generalcompute.com/examples/vercel-ai-chat
Build a streaming chat app with General Compute and the Vercel AI SDK in Next.js.
Build a complete streaming chat application using Next.js and the Vercel AI SDK, powered by General Compute's fast inference.
Clone the full example project:
```bash theme={null}
git clone https://github.com/generalcompute/docs
cd docs/examples/vercel-ai-chat
npm install
```
## 1. Install dependencies
```bash theme={null}
npx create-next-app@latest my-chat-app
cd my-chat-app
npm install ai @ai-sdk/openai-compatible @ai-sdk/react
```
## 2. Create the API route
The Vercel AI SDK has an `@ai-sdk/openai-compatible` provider that works with any OpenAI-compatible API — including General Compute.
```typescript app/api/chat/route.ts theme={null}
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { streamText } from "ai";
const generalcompute = createOpenAICompatible({
name: "generalcompute",
baseURL: "https://api.generalcompute.com/v1",
headers: {
Authorization: `Bearer ${process.env.GENERALCOMPUTE_API_KEY}`,
},
});
export async function POST(req: Request) {
const { messages } = await req.json();
const result = streamText({
model: generalcompute("minimax-m2.7"),
// Convert UI messages (parts format) to model messages (content format)
messages: messages.map((m: { role: string; parts?: { type: string; text: string }[]; content?: string }) => ({
role: m.role,
content: m.parts
? m.parts.filter((p) => p.type === "text").map((p) => p.text).join("")
: m.content,
})),
});
return result.toUIMessageStreamResponse();
}
```
We're using `minimax-m2.7` here — our best general-purpose model with 160k context at an unbeatable price. Swap it for `deepseek-v3.2` if you need stronger reasoning. See all models on the [Models & Pricing](/models) page.
## 3. Create the chat UI
The `useChat` hook from `@ai-sdk/react` handles message state and streaming. You manage input state yourself and call `sendMessage()` to send messages.
```tsx app/page.tsx theme={null}
"use client";
import { useChat } from "@ai-sdk/react";
import { useState } from "react";
export default function Chat() {
const { messages, sendMessage, status } = useChat();
const [input, setInput] = useState("");
const isLoading = status === "streaming" || status === "submitted";
return (
Chat with General Compute
{messages.map((m) => (
{m.role === "user" ? "You" : "AI"}:
{m.parts
?.filter((p) => p.type === "text")
.map((p) => p.text)
.join("")}
))}
);
}
```
## 4. Add your API key
Create a `.env.local` file in your project root:
```bash .env.local theme={null}
GENERALCOMPUTE_API_KEY=gc_your_api_key_here
```
## 5. Run it
```bash theme={null}
npm run dev
```
Open [http://localhost:3000](http://localhost:3000) and start chatting. Responses stream in token-by-token.
## Next steps
* Swap `minimax-m2.7` for `deepseek-v3.2` to try reasoning capabilities
* Add system prompts by prepending to the `messages` array in the API route
* Deploy to Vercel with `vercel deploy` — just add `GENERALCOMPUTE_API_KEY` to your environment variables
# Capabilities
Source: https://docs.generalcompute.com/features
Key GeneralCompute features: tool calling, JSON mode, and reasoning-ready models.
## OpenAI-compatible surface
Every GeneralCompute endpoint mirrors the OpenAI API shape (`chat.completions`, `models`, etc.). Use any existing OpenAI SDK or the official `@generalcompute/sdk` / `generalcompute` packages — no request body changes required.
## Tool calling & JSON mode
Function and tool calling are fully supported. Define tools exactly as you would with OpenAI and inspect the returned `tool_calls` array to decide which function to execute.
```typescript theme={null}
const completion = await client.chat.completions.create({
model: "deepseek-v3.2",
messages,
tools: [
{
type: "function",
function: {
name: "get_weather",
description: "Look up the weather for a city",
parameters: {
type: "object",
properties: { location: { type: "string" } },
required: ["location"],
},
},
},
],
response_format: { type: "json_object" }, // JSON mode
});
```
> Tool calls stream through the same delta events you receive from OpenAI, so orchestrators such as LangChain, Vercel AI SDK, and LlamaIndex work out of the box.
## Reasoning models
Reasoning-first models (`deepseek-v3.2`, `deepseek-v3.1`) are deployed with higher thinking timeouts. Use them when you need chain-of-thought quality:
```typescript theme={null}
const completion = await client.chat.completions.create({
model: "deepseek-v3.2",
messages,
temperature: 0.1,
max_completion_tokens: 2048,
});
```
Combine reasoning with tool calling to build autonomous agents without changing your orchestrator code.
# Introduction
Source: https://docs.generalcompute.com/index
Welcome to GeneralCompute. The world's fastest inference with the best developer experience.
## What is GeneralCompute?
GeneralCompute provides **OpenAI-compatible** SDKs for Node.js and Python, offering a drop-in replacement for the OpenAI SDK. We operate the fastest inference layer on top of premium models like MiniMax M2.7 and DeepSeek V3.2 — no need to reason about SambaCloud vs. SambaStack SKUs or other upstream product names.
### Key features
* **OpenAI-compatible** surface: same endpoints, parameters, and streaming semantics
* **Tool calling & JSON mode** so agents can safely act on structured outputs
* **Reasoning-ready models** with deliberate thinking steps
* **Lightning-fast inference** with optimized runtimes and queueing
* **Simple migration** — swap your import and API key to move workloads in minutes
## Platform coverage
* **Regions:** All production traffic runs in `us-west-2` today; dedicated regions are available for Enterprise deployments.
* **SLA:** Pay-as-you-go plans inherit best-effort reliability. Enterprise tiers include contractual SLAs, escalation paths, and dedicated capacity.
* **Compatibility:** Every feature highlighted in these docs (tool calling, JSON mode, reasoning) shares the same OpenAI-compatible interface, so your orchestrators keep working.
## Getting Started
Get up and running in minutes with our quickstart guide.
Follow our quickstart guide to start using GeneralCompute.
Need credentials first? Visit the [API Keys & Base URLs](/api-keys) guide to create a key and pick the right environment.
## Learn More
Explore our documentation and API reference.
Complete API documentation and endpoint examples.
Get started with our Node.js/TypeScript SDK.
Get started with our Python SDK.
Tool calling, JSON mode, and reasoning notes.
Switch from OpenAI to GeneralCompute.
Create, rotate, and scope API keys with the correct base URL.
See all available models with pricing.
Understand rate limits and plan quotas.
# Migrate with AI
Source: https://docs.generalcompute.com/migrate-with-ai
Copy-paste prompts to let your AI coding agent migrate your project to General Compute in minutes.
Use any AI coding agent to migrate your project to General Compute. Copy the prompt below, paste it into your agent, and let it handle the rest.
This works with **any** agent that can read your codebase and edit files:
Using OpenClaw? Start with the dedicated [OpenClaw guide](/openclaw) for provider config, model routing, and signup flow details.
***
## Migration prompt
Copy and paste this into your AI coding agent:
### OpenAI SDK → General Compute
General Compute is a drop-in replacement — keep using the OpenAI SDK, just point it at General Compute.
```text theme={null}
Migrate this project from OpenAI to General Compute. General Compute is a drop-in replacement — keep using the OpenAI SDK, just point it at General Compute.
1. Change the base URL and API key in the client constructor:
- Node.js: new OpenAI({ baseURL: "https://api.generalcompute.com/v1", apiKey: process.env.GENERALCOMPUTE_API_KEY })
- Python: OpenAI(base_url="https://api.generalcompute.com/v1", api_key=os.getenv("GENERALCOMPUTE_API_KEY"))
2. Update model names:
- gpt-4o, gpt-4, gpt-3.5-turbo → minimax-m2.7 (general purpose) or deepseek-v3.2 (reasoning)
- See all models: https://docs.generalcompute.com/models
3. Update environment variables:
- Add GENERALCOMPUTE_API_KEY to all .env files, CI configs, and deployment settings.
Everything else stays the same — imports, client.chat.completions.create(), streaming, tool calling, JSON mode, and all parameters work identically.
Docs: https://docs.generalcompute.com/quickstart
```
***
### Anthropic SDK → General Compute
General Compute has its own SDK that's a drop-in replacement for OpenAI — swap the Anthropic SDK for ours.
```text theme={null}
Migrate this project from the Anthropic SDK to the General Compute SDK. General Compute uses an OpenAI-compatible API, so you'll replace the Anthropic SDK with @generalcompute/sdk (Node.js) or generalcompute (Python).
1. Replace the Anthropic SDK with the General Compute SDK:
- Node.js: npm uninstall @anthropic-ai/sdk && npm install @generalcompute/sdk
- Python: pip uninstall anthropic && pip install generalcompute
2. Replace the client constructor:
- Node.js (before): import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic();
- Node.js (after): import GeneralCompute from "@generalcompute/sdk"; const client = new GeneralCompute();
- Python (before): from anthropic import Anthropic; client = Anthropic()
- Python (after): from generalcompute import GeneralCompute; client = GeneralCompute()
3. Replace all API calls — the method names and response shapes are different:
- client.messages.create() → client.chat.completions.create()
- message.content[0].text → completion.choices[0].message.content
- max_tokens is optional on General Compute (not required like Anthropic)
- system parameter → put system message as first item in messages array with role: "system"
- Streaming: client.messages.stream() → client.chat.completions.create({ stream: true }), then iterate chunks with chunk.choices[0].delta.content
- Tool use: Anthropic's tool_use/tool_result blocks → OpenAI-style tools array and tool_calls in responses
4. Update model names:
- claude-sonnet-4-20250514, claude-opus-4-20250514, claude-haiku-3-5-20241022 → minimax-m2.7 (general purpose) or deepseek-v3.2 (reasoning)
- See all models: https://docs.generalcompute.com/models
5. Update environment variables:
- Replace ANTHROPIC_API_KEY with GENERALCOMPUTE_API_KEY in all .env files, CI configs, and deployment settings.
Docs: https://docs.generalcompute.com/quickstart
API reference: https://docs.generalcompute.com/api-reference/introduction
```
***
### Vercel AI SDK → General Compute provider
The Vercel AI SDK has an OpenAI-compatible provider that works with General Compute out of the box.
```text theme={null}
Migrate this project's Vercel AI SDK setup to use General Compute as the inference provider.
1. Install the provider: npm install @ai-sdk/openai-compatible
2. Replace the model provider. Find where you create your AI model (e.g. openai("gpt-4o"), anthropic("claude-sonnet-4-20250514"), etc.) and replace it with:
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
const generalcompute = createOpenAICompatible({
name: "generalcompute",
baseURL: "https://api.generalcompute.com/v1",
headers: {
Authorization: `Bearer ${process.env.GENERALCOMPUTE_API_KEY}`,
},
});
Then use generalcompute("minimax-m2.7") wherever you previously passed a model.
3. Update model names:
- Use minimax-m2.7 for general purpose or deepseek-v3.2 for reasoning
- See all models: https://docs.generalcompute.com/models
4. Update environment variables:
- Add GENERALCOMPUTE_API_KEY to .env.local and deployment settings
- Remove any previous provider API keys that are no longer needed
5. Important if using AI SDK v6 (ai@6 or later):
- The useChat hook comes from @ai-sdk/react (not ai/react) — install it: npm install @ai-sdk/react
- Use toUIMessageStreamResponse() (not toDataStreamResponse()) in API routes
- Messages use a parts array — render with: m.parts.filter(p => p.type === "text").map(p => p.text).join("")
- handleSubmit/handleInputChange/isLoading are removed — use sendMessage(), manage input with useState, check status
Docs: https://docs.generalcompute.com/quickstart#build-a-streaming-chat-with-vercel-ai-sdk
```
***
### Any OpenAI-compatible client → General Compute
If your project already uses an OpenAI-compatible client (LangChain, LiteLLM, OpenClaw, curl, etc.), just change the base URL.
```text theme={null}
Migrate this project to use General Compute for inference. General Compute is OpenAI-compatible, so any client that works with OpenAI works with General Compute.
1. Change the base URL to: https://api.generalcompute.com/v1
2. Change the API key to use GENERALCOMPUTE_API_KEY instead of whatever provider key is currently set.
3. Update model names:
- Use minimax-m2.7 for general purpose or deepseek-v3.2 for reasoning
- See all models: https://docs.generalcompute.com/models
4. Update environment variables in all .env files, CI configs, and deployment settings.
That's it. All endpoints, parameters, streaming, tool calling, and JSON mode work identically.
Docs: https://docs.generalcompute.com/quickstart
API reference: https://docs.generalcompute.com/api-reference/introduction
```
These prompts reference our documentation so your agent can look up model names, capabilities, and code examples if it needs more context.
# Models & Pricing
Source: https://docs.generalcompute.com/models
Explore all available models on General Compute with pricing, context windows, and capabilities.
## Available Models
General Compute offers a wide range of open-source and open-weight models. All models are served via our OpenAI-compatible API.
### Recommended
These are our top picks for the best balance of quality, speed, and cost.
Our best general-purpose model. Exceptional quality with a 192k context window at an unbeatable price. Perfect for production workloads.
**Model ID:** `minimax-m2.7`
State-of-the-art reasoning model. Best-in-class performance on complex tasks with built-in chain-of-thought reasoning.
**Model ID:** `deepseek-v3.2`
### All Models
| Model | Model ID | Context | Input / 1M tokens | Output / 1M tokens | Capabilities |
| ----------------- | --------------- | ------- | ----------------- | ------------------ | ------------ |
| **MiniMax M2.7** | `minimax-m2.7` | 192k | \$0.28 | \$1.20 | |
| **DeepSeek V3.2** | `deepseek-v3.2` | 32k | \$0.25 | \$0.38 | Reasoning |
| DeepSeek V3.1 | `deepseek-v3.1` | 128k | \$0.21 | \$0.79 | Reasoning |
| GPT-OSS 120B | `gpt-oss-120b` | 128k | \$0.21 | \$0.79 | |
### Model Capabilities
* **Reasoning** — Models with built-in chain-of-thought reasoning. These models think step-by-step before producing a final answer, leading to significantly better results on complex tasks like math, code, and analysis.
### Choosing a Model
| Use Case | Recommended Model | Why |
| --------------------------------- | ----------------- | ---------------------------------------------- |
| General-purpose chat & generation | `minimax-m2.7` | Best quality-to-cost ratio, 192k context |
| Complex reasoning & analysis | `deepseek-v3.2` | State-of-the-art reasoning capabilities |
| Longer-context reasoning | `deepseek-v3.1` | 128k context window for longer reasoning tasks |
| Large context windows | `minimax-m2.7` | 192k context at low cost |
## Custom checkpoints
Bring your own LoRA, GGUF, or full-finetuned checkpoints and run them on the same ultra-low latency infrastructure:
* Share the model artifact (S3, Hugging Face, or direct upload) with the GeneralCompute team.
* We containerize the checkpoint, attach accelerators in `us-west-2`, and expose it behind a private model ID (for example `acme/my-custom-model`).
* Your private IDs behave exactly like any other `model` parameter in the OpenAI-compatible API, including streaming, tool calling, and function execution.
* Enterprise plans layer on SLAs, dedicated pools, and per-org allow lists.
Contact [support@generalcompute.com](mailto:support@generalcompute.com) to schedule onboarding or to request deployments in additional regions.
All prices are in USD. Pricing is based on token usage with no minimum commitment on the Pay As You Go plan.
# OpenClaw Integration
Source: https://docs.generalcompute.com/openclaw
Connect your OpenClaw AI assistant to General Compute for 5x faster inference with $5 in free credit.
## OpenClaw on General Compute
OpenClaw is an open-source AI assistant with 247k+ GitHub stars. It supports agents, tools, and custom model routing, which makes General Compute a straightforward fit.
General Compute delivers **5x faster inference**, so OpenClaw chats, coding turns, and tool loops feel much more responsive.
New General Compute accounts start with **\$5 in free credit**, which is enough to test a real OpenClaw workflow before moving more traffic over.
OpenClaw can talk to General Compute through its standard `openai-completions` provider path. You change config, not your workflow.
OpenClaw stores its default config at `~/.openclaw/openclaw.json`. Run `openclaw config file` to print the active path, or override it with `OPENCLAW_CONFIG_PATH`.
## For agents
OpenClaw is already an agent, so it can follow these instructions itself. OpenClaw, you can get your own General Compute API key through [Agent Signup](/agent-signup) and then swap your inference provider to General Compute.
1. Ask the user for their email address.
2. Call `POST /v1/public/agent-signups` with `{"email": ""}`.
3. Get the 6-digit code from `noreply@generalcompute.com`. Most agents don't have their own email access — default to asking the user to read the code to you, unless you have an email tool wired up and know it can read this inbox.
4. Call `POST /v1/public/agent-signups/{signupId}/verify` with `{"code": ""}`.
5. Paste the full `generalcompute` provider block (shown below) into `openclaw.json`, with the returned `apiKey` as a literal string. Use the JSON paste for fresh setups — the `openclaw config set` shortcut only writes the apiKey and leaves `baseUrl`, `api`, and the `models` map unset, which is not enough for inference to work.
6. Validate with `openclaw config validate` and `openclaw models list`. The JSON paste already sets `agents.defaults.model.primary` to `generalcompute/minimax-m2.7` (160k context; good for chat, coding, and agent tool loops), so you do **not** also need `openclaw models set`.
7. Restart the gateway using the user-handoff pattern described below. Do **not** just run `openclaw gateway restart` and wait for a reply — it will cut off your own inference mid-turn and the user will see you go silent. See the Warning below for why.
**Do not use `${GENERALCOMPUTE_API_KEY}` in `openclaw.json`.** The gateway runs detached from the user's shell (launchd on macOS, systemd on Linux), so env vars set in `~/.zshrc` / `~/.bashrc` are invisible to it. Write the key as a literal string in the config file. A missing-env error at startup does not always fail loudly — the gateway can appear "up" while silently failing every inference call.
First, find the config path:
```bash theme={null}
openclaw config file # e.g. /Users/you/.openclaw/openclaw.json
```
For a fresh setup, paste this provider block into `openclaw.json` (replace `gc_your_api_key` with the key returned in step 4):
```json5 theme={null}
{
agents: {
defaults: {
model: {
primary: "generalcompute/minimax-m2.7",
fallbacks: [
"generalcompute/deepseek-v3.2",
"generalcompute/deepseek-v3.1",
],
},
},
},
models: {
mode: "merge",
providers: {
generalcompute: {
api: "openai-completions",
baseUrl: "https://api.generalcompute.com/v1",
apiKey: "gc_your_api_key",
models: {
"minimax-m2.7": { contextWindow: 160000 },
"deepseek-v3.2": { contextWindow: 32000 },
"deepseek-v3.1": { contextWindow: 128000 },
},
},
},
},
}
```
If the `generalcompute` provider block is already set up and you're just rotating the key, you can shortcut to:
```bash theme={null}
openclaw config set models.providers.generalcompute.apiKey gc_your_api_key
```
Do not use this on a fresh setup — it only writes `apiKey` and won't create `baseUrl`, `api`, or the `models` map.
Then validate:
```bash theme={null}
openclaw config validate
openclaw models list
```
Skip `openclaw models set` — the JSON paste already sets the default model via `agents.defaults.model.primary`. Only run `openclaw models set` later if you want to change the default, or if you took a CLI-only path instead of pasting the JSON.
**`openclaw gateway restart` will cut off your own inference mid-turn.** OpenClaw agents route their model calls through the OpenClaw gateway process. When you restart that gateway, the inference request serving your current turn is killed, so you cannot send a reply confirming the restart finished — the user will see you go silent regardless of what the gateway actually does. **Do not treat this like a normal command — hand control to the user *before* running it.**
Instead of running `restart` silently, follow the same pattern as the verification-code step: tell the user what's about to happen, explicitly ask them to re-engage you after it's done, then run the restart. This is a user-handoff, not a background task.
Say something close to this to the user, in your own words:
> I'm about to run `openclaw gateway restart`. OpenClaw restarts the process I'm running inside, so I won't be able to message you when it's back up. **Please message me again in about 30 seconds** (anything works — "you back?" is fine) and I'll verify the gateway came up cleanly and that inference is live.
Then, and only after the user has acknowledged, run:
```bash theme={null}
openclaw gateway restart
```
When the user messages you again, verify the gateway is actually up before declaring success:
```bash theme={null}
openclaw gateway status
tail -n 20 ~/.openclaw/logs/gateway.err.log
```
If the status is healthy and the log is clean, tell the user inference is live. If you see `SecretRefResolutionError` or `Gateway failed to start` in the log, the key is not reaching the gateway process — re-check that `apiKey` is a literal string in `openclaw.json`, not a `${...}` template (see the warning above), then repeat the handoff + restart.
Use the public signup flow to provision a General Compute key directly inside your agent workflow. This is the recommended path for OpenClaw.
## For humans
If you are configuring OpenClaw yourself, create a General Compute API key first, then update the OpenClaw config to point inference at General Compute.
1. Create an API key at [generalcompute.com](https://generalcompute.com), or let your agent do it for you with [Agent Signup](/agent-signup).
2. Run `openclaw config file` and open the config file it prints.
3. Paste the `generalcompute` provider config above into `openclaw.json`, using the literal API key as `apiKey`.
4. Run `openclaw config validate` to confirm the config parses, then `openclaw gateway restart`. The JSON paste already sets `agents.defaults.model.primary` to `generalcompute/minimax-m2.7`, so `openclaw models set` isn't needed.
5. Give it \~30 seconds, then confirm with `openclaw gateway status` and `tail ~/.openclaw/logs/gateway.err.log` — a clean log means inference is live. If you were running this flow through an agent, the agent won't be able to message you when the restart completes (it's restarting the process it's running in), so re-engage it after 30 seconds and ask it to verify.
Do not rely on `export GENERALCOMPUTE_API_KEY=...` in your shell rc. The OpenClaw gateway runs under launchd on macOS and systemd on Linux — neither inherits env from `~/.zshrc` or `~/.bashrc`. Write the key as a literal value in `openclaw.json`. See the warning above.
## Recommended models
These are a practical starter set for OpenClaw — `minimax-m2.7` is the recommended default. See [Models & Pricing](/models) for the full catalog.
| Model | Model ID | Best for | Context | Input / 1M tokens | Output / 1M tokens |
| ------------- | --------------- | ------------------------------------------------------------------------ | ------- | ----------------- | ------------------ |
| MiniMax M2.7 | `minimax-m2.7` | Default chat, coding, and agent turns — recommended primary for OpenClaw | 160k | \$0.40 | \$2.34 |
| DeepSeek V3.2 | `deepseek-v3.2` | Reasoning on complex tasks | 32k | \$3.00 | \$4.50 |
| DeepSeek V3.1 | `deepseek-v3.1` | Reasoning with a larger context window | 128k | \$3.00 | \$4.50 |
## Migrating from other providers
If you already have OpenClaw pointed at OpenAI, OpenRouter, Together, or another proxy, the migration is usually just a provider swap.
| Current setup | What changes for General Compute |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OpenAI-compatible provider | Keep `api: "openai-completions"`, change `baseUrl` to `https://api.generalcompute.com/v1`, set `apiKey` to your General Compute key as a literal, and update your default model to `generalcompute/` |
| Anthropic or another non-OpenAI API | Move the provider to `openai-completions`, then set the default model with `openclaw models set generalcompute/minimax-m2.7` |
| Existing agent bootstrap flow | Point it at [Agent Signup](/agent-signup) to create keys programmatically, then reuse the same OpenClaw config shape |
For codebase-wide migrations outside OpenClaw, use [Migrate with AI](/migrate-with-ai).
# Quickstart
Source: https://docs.generalcompute.com/quickstart
Get started with the world's fastest inference using our OpenAI-compatible SDKs.
## Installation
General Compute offers OpenAI-compatible SDKs for Node.js and Python, providing a drop-in replacement for OpenAI's SDK.
```bash Node.js theme={null}
npm install @generalcompute/sdk
```
```bash Python theme={null}
pip install generalcompute
```
## API Key Setup
Create a key from the dashboard and configure your base URL by following the [API Keys & Base URLs](/api-keys) guide. Once the key is stored (for example, in `GENERALCOMPUTE_API_KEY`) you can initialize the SDKs as shown below.
## Quick Start
### Node.js / TypeScript
```typescript theme={null}
import GeneralCompute from "@generalcompute/sdk";
const client = new GeneralCompute();
const completion = await client.chat.completions.create({
model: "minimax-m2.7",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(completion.choices[0].message.content);
```
### Python
```python theme={null}
from generalcompute import GeneralCompute
client = GeneralCompute()
response = client.chat.completions.create(
model="minimax-m2.7",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
)
print(response.choices[0].message.content)
```
## Streaming
Both SDKs support streaming responses for real-time output.
```typescript Node.js theme={null}
import GeneralCompute from "@generalcompute/sdk";
const client = new GeneralCompute();
const stream = await client.chat.completions.create({
model: "minimax-m2.7",
messages: [{ role: "user", content: "Write a short poem" }],
stream: true,
});
for await (const chunk of stream) {
const content = chunk.choices[0]?.delta?.content;
if (content) {
process.stdout.write(content);
}
}
```
```python Python theme={null}
from generalcompute import GeneralCompute
client = GeneralCompute()
stream = client.chat.completions.create(
model="minimax-m2.7",
messages=[
{"role": "user", "content": "Write a short poem"}
],
stream=True,
)
for chunk in stream:
content = chunk.choices[0].delta.content
if content:
print(content, end="", flush=True)
```
## Build a Streaming Chat with Vercel AI SDK
The Vercel AI SDK works seamlessly with General Compute. Here's a complete Next.js chat app with streaming.
Check out the full example project in our [examples/vercel-ai-chat](https://github.com/generalcompute/docs/tree/main/examples/vercel-ai-chat) directory.
### 1. Install dependencies
```bash theme={null}
npx create-next-app@latest my-chat-app
cd my-chat-app
npm install ai @ai-sdk/openai-compatible @ai-sdk/react
```
### 2. Create the API route
```typescript app/api/chat/route.ts theme={null}
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { streamText } from "ai";
const generalcompute = createOpenAICompatible({
name: "generalcompute",
baseURL: "https://api.generalcompute.com/v1",
headers: {
Authorization: `Bearer ${process.env.GENERALCOMPUTE_API_KEY}`,
},
});
export async function POST(req: Request) {
const { messages } = await req.json();
const result = streamText({
model: generalcompute("minimax-m2.7"),
// Convert UI messages (parts format) to model messages (content format)
messages: messages.map((m: { role: string; parts?: { type: string; text: string }[]; content?: string }) => ({
role: m.role,
content: m.parts
? m.parts.filter((p) => p.type === "text").map((p) => p.text).join("")
: m.content,
})),
});
return result.toUIMessageStreamResponse();
}
```
### 3. Create the chat UI
```tsx app/page.tsx theme={null}
"use client";
import { useChat } from "@ai-sdk/react";
import { useState } from "react";
export default function Chat() {
const { messages, sendMessage, status } = useChat();
const [input, setInput] = useState("");
const isLoading = status === "streaming" || status === "submitted";
return (
Chat with General Compute
{messages.map((m) => (
{m.role === "user" ? "You" : "AI"}:
{m.parts
?.filter((p) => p.type === "text")
.map((p) => p.text)
.join("")}
))}
);
}
```
### 4. Add your API key
```bash .env.local theme={null}
GENERALCOMPUTE_API_KEY=gc_your_api_key_here
```
Run `npm run dev` and open [http://localhost:3000](http://localhost:3000) — you have a streaming chat app.
## Build a Streaming Chat with Node.js
No framework needed — here's a complete streaming chat using just Node.js and the General Compute SDK.
Check out the full example project in our [examples/node-streaming](https://github.com/generalcompute/docs/tree/main/examples/node-streaming) directory.
```typescript index.ts theme={null}
import GeneralCompute from "@generalcompute/sdk";
import * as readline from "readline";
const client = new GeneralCompute();
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
const messages: { role: "system" | "user" | "assistant"; content: string }[] = [
{ role: "system", content: "You are a helpful assistant." },
];
async function chat(userMessage: string) {
messages.push({ role: "user", content: userMessage });
const stream = await client.chat.completions.create({
model: "minimax-m2.7",
messages,
stream: true,
});
let assistantMessage = "";
process.stdout.write("\nAssistant: ");
for await (const chunk of stream) {
const content = chunk.choices[0]?.delta?.content;
if (content) {
process.stdout.write(content);
assistantMessage += content;
}
}
console.log("\n");
messages.push({ role: "assistant", content: assistantMessage });
}
function prompt() {
rl.question("You: ", async (input) => {
if (input.toLowerCase() === "exit") {
rl.close();
return;
}
await chat(input);
prompt();
});
}
console.log('Chat with General Compute (type "exit" to quit)\n');
prompt();
```
Run it with:
```bash theme={null}
npx tsx index.ts
```
## Migration from OpenAI
Switching from OpenAI's SDK to GeneralCompute is a one-line change:
### Before (OpenAI)
```typescript Node.js theme={null}
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});
const completion = await client.chat.completions.create({
model: "gpt-4",
messages: [{ role: "user", content: "Hello!" }],
});
```
```python Python theme={null}
from openai import OpenAI
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Hello!"}]
)
```
### After (GeneralCompute)
```typescript Node.js theme={null}
import GeneralCompute from "@generalcompute/sdk";
const client = new GeneralCompute({
apiKey: process.env.GENERALCOMPUTE_API_KEY, // Changed
});
const completion = await client.chat.completions.create({
model: "minimax-m2.7", // Changed
messages: [{ role: "user", content: "Hello!" }],
});
```
```python Python theme={null}
from generalcompute import GeneralCompute
client = GeneralCompute(api_key=os.getenv("GENERALCOMPUTE_API_KEY")) # Changed
response = client.chat.completions.create(
model="minimax-m2.7", # Changed
messages=[{"role": "user", "content": "Hello!"}]
)
```
**What changed:**
1. Import: `openai` → `@generalcompute/sdk` (Node) or `generalcompute` (Python)
2. API key: `OPENAI_API_KEY` → `GENERALCOMPUTE_API_KEY`
3. Model name: `gpt-4` → `minimax-m2.7` (or your chosen model)
**What stayed the same:**
* Method name: `client.chat.completions.create()`
* Parameters: `messages`, `temperature`, `stream`, etc.
* Response format: Same structure and types
* Streaming: Same async iteration pattern
## Next Steps
See all available models with pricing and capabilities.
Understand rate limits and plan quotas.
Explore the complete API documentation.
Clone and run complete example projects.
**Need help?** Contact us at [support@generalcompute.com](mailto:support@generalcompute.com) or visit our [documentation](https://docs.generalcompute.com).
# Rate Limits
Source: https://docs.generalcompute.com/rate-limits
Understand rate limits and quotas for each General Compute plan.
## Plans & Rate Limits
General Compute offers four plans to match your usage needs. All plans include access to every model.
### Pay As You Go
No monthly fee. Add a card to enable auto-reload.
| Limit | Value |
| ------------------- | ---------- |
| Requests per minute | 100 |
| Tokens per minute | 200,000 |
| Requests per day | 50,000 |
| Tokens per day | 10,000,000 |
### Developer — \$50/mo
For growing applications with higher throughput needs.
| Limit | Value |
| ------------------- | ----------- |
| Requests per minute | 500 |
| Tokens per minute | 1,000,000 |
| Requests per day | 250,000 |
| Tokens per day | 100,000,000 |
### Scale — \$1,000/mo
For production workloads with high throughput.
| Limit | Value |
| ------------------- | ----------- |
| Requests per minute | 2,000 |
| Tokens per minute | 5,000,000 |
| Requests per day | 1,000,000 |
| Tokens per day | 500,000,000 |
### Enterprise — Custom
For organizations that need custom limits, dedicated infrastructure, or SLAs. [Contact us](mailto:support@generalcompute.com) to discuss your needs.
## Rate Limit Headers
Every API response includes headers to help you track your usage:
```
x-ratelimit-limit-requests: 500
x-ratelimit-remaining-requests: 299
x-ratelimit-reset-requests: 2024-01-01T00:00:00Z
```
## Handling Rate Limits
When you exceed a rate limit, the API returns a `429 Too Many Requests` response. We recommend implementing exponential backoff:
```typescript Node.js theme={null}
import GeneralCompute from "@generalcompute/sdk";
const client = new GeneralCompute();
// The SDK automatically retries on 429 errors with exponential backoff.
// You can configure the retry behavior:
const client = new GeneralCompute({
maxRetries: 3, // default is 2
});
```
```python Python theme={null}
from generalcompute import GeneralCompute
client = GeneralCompute()
# The SDK automatically retries on 429 errors with exponential backoff.
# You can configure the retry behavior:
client = GeneralCompute(max_retries=3) # default is 2
```
Need higher limits? [Upgrade your plan](https://generalcompute.com) or [contact us](mailto:support@generalcompute.com) for Enterprise pricing.