This guide takes you from a fresh account to your first model response. Pick the Playground (about a minute), the OpenAI-compatible API (about five minutes), or a coding agent like OpenCode — they all use the same models and the same credit.
New accounts include $1 of inference credit. No credit card required.
1. Try the Playground
Sign in at graphn.ai and select a workspace (or create one).
Open Playground in the sidebar.
Pick a model. DeepSeek V4.1 Flash is a strong general-purpose choice; Qwen3 80B is the platform's default chat model.
Type a prompt and send it. The answer streams in, and the panel shows the prompt and completion token counts. The charge for the request is in Logs.
2. Create an API key
In the app, open API keys at the bottom of the sidebar and create a key. Keys start with gn_ and belong to one workspace; requests made with a key are billed to that workspace's organization.
streamText and tool calling work with every built-in chat model. Output.object requires a model with structured-output support; see Models. includeUsage returns token counts on streamed replies, and supportsStructuredOutputs sends your schema as JSON Schema. Model-specific parameters go under providerOptions.graphn, such as { graphn: { reasoningEffort: "low" } } or { graphn: { chat_template_kwargs: { enable_thinking: false } } }.
CLI
bash
brew tap voltagepark/graphn && brew install graphn
graphn login
graphn model chat qwen3-80b -m"Hello"
The command prints the model's reply in the terminal. graphn model chat without -m starts an interactive session. See Developing with agents for other install options.
4. Pick a model
The model field takes the model's callable name, such as qwen3-80b, deepseek-v4.1-flash, or glm-5.3. Models lists every built-in model with its context window, and each links to a page with pricing. To list the models your key can call:
Models you import or deploy yourself are called the same way, as imported:<id> or custom:<id>. The Playground in the app runs any of them and shows the matching request in its Code view.
Thinking models: DeepSeek V4.1 Flash can return its reasoning in reasoning_content, alongside the answer in content. Qwen3 80B is instruct-only and never emits a separate reasoning field. Reasoning counts toward max_tokens, so allow a few thousand output tokens — a thinking model given a small budget can return empty content with finish_reason: "length". To turn thinking off, pass chat_template_kwargs: {"enable_thinking": false} (see Parameters beyond the OpenAI SDK).
5. Use a coding agent
OpenCode and other OpenAI-compatible clients can use GraphN as a provider. Every client needs the same three values: the base URL https://model.graphn.ai/v1, your workspace API key, and a callable model name.
This section covers OpenCode. For Claude Code, Codex and Cursor, which each speak a different API, see Coding agents.
OpenCode
Create an API key (see Step 2) and export it:
bash
exportGRAPHN_API_KEY="gn_..."
Add GraphN to ~/.config/opencode/opencode.json or opencode.jsonc (or a project-level opencode.json):
Run opencode, then /models, and pick GraphN → DeepSeek V4.1 Flash (or another model with tool calling).
The keys in models must match the callable model names from the models reference; add or remove entries to match the models you want in the picker. Keep reasoningEffort on GLM-5.3: without it, GLM-5.3 can think until it hits the output limit, and OpenCode ends the session without a reply.
Any client that accepts an OpenAI-compatible base URL works the same way: set the base URL to https://model.graphn.ai/v1, use your gn_ key, and the model's callable name. For the GraphN CLI and agent workflows, see Developing with agents.
Streaming
Set stream to receive the reply as server-sent events, one chunk at a time:
python
stream = client.chat.completions.create( model="qwen3-80b", messages=[{"role":"user","content":"Write a haiku about GPUs."}], stream=True,)for chunk in stream:if chunk.choices and chunk.choices[0].delta.content:print(chunk.choices[0].delta.content, end="", flush=True)
Images
Vision models take OpenAI-style content parts. An image can be an https URL or a data: URL:
python
response = client.chat.completions.create( model="qwen3-vl", messages=[{"role":"user","content":[{"type":"text","text":"What is in this image?"},{"type":"image_url","image_url":{"url":"https://example.com/photo.jpg"}},],}],)
Parameters beyond the OpenAI SDK
Some models take parameters the OpenAI SDK does not define, such as top_k or a thinking switch. In Python, pass them through extra_body: