Quickstart
Make your first request in under five minutes. All you need is an account, an API key and any OpenAI-compatible client.
Before you begin
Topo speaks the OpenAI wire format, so anything that can call OpenAI can call Topo. This guide uses cURL, the official OpenAI SDKs and the claude-sonnet-5.5 model. New accounts start with $5 of free credit, so you do not need to fund a wallet yet.
Make a request
- 01
Create an account
Sign up at topolabs.ai/signup with an email or a wallet. A team wallet is created for you and credited with $5 of inference credit.
- 02
Create an API key
In the dashboard, open API keys and choose New key. Name it something like
local-devand copy it once: it starts withtp_live_and is never shown again.bashexport TOPO_API_KEY="tp_live_8f3a…c21e" - 03
Install a client
Use the OpenAI SDK you already know. The Topo SDKs are optional and add typed receipts, wallets and agents.
pip install openainpm install openai - 04
Send a chat completion
Point the client at
https://api.topolabs.ai/v1and send a request. Nothing else changes.curl https://api.topolabs.ai/v1/chat/completions \ -H "Authorization: Bearer $TOPO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-5.5", "messages": [{ "role": "user", "content": "Explain zk proofs in 3 lines" }], "pay_with": "usdt" }'import osfrom openai import OpenAI client = OpenAI( base_url="https://api.topolabs.ai/v1", api_key=os.environ["TOPO_API_KEY"],) response = client.chat.completions.create( model="claude-sonnet-5.5", messages=[{"role": "user", "content": "Explain zk proofs in 3 lines"}],) print(response.choices[0].message.content)import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://api.topolabs.ai/v1", apiKey: process.env.TOPO_API_KEY,}); const response = await client.chat.completions.create({ model: "claude-sonnet-5.5", messages: [{ role: "user", content: "Explain zk proofs in 3 lines" }],}); console.log(response.choices[0].message.content);
Read the response
The response is a standard chat completion. Topo appends a topo object with the node that served the request, the verification result and the settlement receipt.
{ "id": "chatcmpl_7Hq2kf91", "object": "chat.completion", "created": 1792142596, "model": "claude-sonnet-5.5", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "A zk proof shows a statement is true without revealing why. ..." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 18, "completion_tokens": 406, "total_tokens": 424 }, "topo": { "request_id": "req_7Hq2kf91", "node": "eu-west-2", "gpu": "B200", "ttft_ms": 182, "attestors": "3/3", "receipt": { "amount": "0.0041", "currency": "USDT", "chain": "base", "tx": "0x51c4…9ab2" } }}