# API access Members can use the co-op's models programmatically through an OpenAI-compatible API. It's the same infrastructure that powers the chat — any OpenAI-compatible client works. ## Quick facts - **Base URL:** `https://gateway.inference.coop/v1` - **Auth:** a bearer API key (create one in the [Member Dashboard](https://dashboard.inference.coop)) - **Format:** OpenAI chat completions — `POST https://gateway.inference.coop/v1/chat/completions` - **Models:** see the table below. API usage draws from the **same monthly allowance as chat** — there's no separate quota. ## Models Models are named `provider/model-name`, so you can choose not just *which* model but *where* it runs. Providers carry a value you can route by: | Model | Provider | Value | |---|---|---| | `deepseek-v4-1-flash` | Tinfoil | **private** (TEE) | | `gpt-oss-120b` | Tinfoil | **private** (TEE) | | `glm-5-3-flash` | Tinfoil | **private** (TEE) | | `greenpt/green-r` | GreenPT | **green** (renewable) | | `greenpt/green-l` | GreenPT | **green** (renewable) | - **Tinfoil** — *private*. Models run inside hardware enclaves (TEEs) with end-to-end encryption, so neither we nor the provider can read your prompts or responses. Best privacy. - **GreenPT** — *green*. Models served on 100% renewable energy in the EU. Cleaner energy, standard (non-enclave) hosting. > **Note:** the three Tinfoil models currently use their bare names (no > `tinfoil/` prefix). They'll be renamed to `tinfoil/deepseek-v4-1-flash` and so > on in an upcoming change — we'll email members before that happens. GreenPT > models already use the `greenpt/` prefix. **Which to pick:** - `deepseek-v4-1-flash` — default; best for agentic tasks (1M context, tool calling). - `gpt-oss-120b` — lightweight fallback. - `glm-5-3-flash` — fast, efficient MoE model. - `greenpt/green-r` — reasoning, renewable energy. - `greenpt/green-l` — lightweight, renewable energy. ## Get a key Log in to the [Member Dashboard](https://dashboard.inference.coop) and create an API key. The key is an `sk-…` string you pass as a bearer token. ## Plain `curl` ```bash curl https://gateway.inference.coop/v1/chat/completions \ -H "Authorization: Bearer sk-your-key" \ -H "Content-Type: application/json" \ -d '{"model": "deepseek-v4-1-flash", "messages": [{"role": "user", "content": "Hello"}]}' ``` ## OpenAI SDK (Python, Node, etc.) Point the SDK at our base URL and use your member key: ```python from openai import OpenAI client = OpenAI( base_url="https://gateway.inference.coop/v1", api_key="sk-your-key", ) resp = client.chat.completions.create( model="deepseek-v4-1-flash", messages=[{"role": "user", "content": "Hello"}], ) ``` Any OpenAI-compatible client works the same way: set the base URL to `https://gateway.inference.coop/v1` and the API key to your member key. ## Coding agents and other OpenAI-compatible clients Any tool that speaks the OpenAI API works. Where a tool asks for provider or endpoint configuration: - **Base URL / endpoint:** `https://gateway.inference.coop/v1` - **API type / protocol:** "OpenAI compatible" (or `openai-completions` where a protocol string must be named) — not "Ollama", "Anthropic", or "Responses" - **API key:** your member key (the `sk-…` string) - **Model:** one from the table above, e.g. `deepseek-v4-1-flash` or `greenpt/green-r` A typical provider entry looks like: ```json { "providers": { "inference-coop": { "baseUrl": "https://gateway.inference.coop/v1", "api": "openai-completions", "apiKey": "sk-your-key", "models": [ { "id": "deepseek-v4-1-flash" }, { "id": "gpt-oss-120b" }, { "id": "glm-5-3-flash" }, { "id": "greenpt/green-r" }, { "id": "greenpt/green-l" } ] } } } ``` If a tool's own docs show a local-server example (e.g. `baseUrl: http://localhost:11434/v1` with `api: "openai-completions"`), substitute our base URL and your member key for `apiKey` — the protocol value stays the same. Some tools append `/chat/completions` to the base URL themselves; if your base URL already ends in `/v1`, that's correct and you should not add `/chat/completions`.