Quickstart
Send your first completion in about five minutes. If you've used the OpenAI API before, you already know the moves — point the client somewhere new and go.
Five minutes to a completion
- 1Create an account
Sign in with email or wallet via Privy. A credit balance is created for you automatically — new accounts get a small amount to try things out.
- 2Get an API key
Open Settings → Keysand create a key. It's shown once — store it as
PIEDPIPER_API_KEY. Keys look likesk-pied-piper-…and can be revoked any time. - 3Point your client at Pied Piper
Use the official @piedpiperrh/sdk, or any OpenAI-compatible client with
baseURLset tohttps://mesh-zeta-eight.vercel.app/v1. - 4Send a request
Pick a model slug from the catalog and call
chat.completions.create. Pied Piper routes it to a live host and streams the result back.
Python
1from openai import OpenAI23client = OpenAI(4api_key=os.environ["PIEDPIPER_API_KEY"],5base_url="https://mesh-zeta-eight.vercel.app/v1",6)78r = client.chat.completions.create(9model="llama-3.2-3b-instruct-q4f32_1",10messages=[{"role": "user", "content": "Explain Pied Piper in one line."}],11)12print(r.choices[0].message.content)
TypeScript
1import OpenAI from "openai";23const client = new OpenAI({4apiKey: process.env.PIEDPIPER_API_KEY,5baseURL: "https://mesh-zeta-eight.vercel.app/v1",6});78const r = await client.chat.completions.create({9model: "llama-3.2-3b-instruct-q4f32_1",10messages: [{ role: "user", content: "Explain Pied Piper in one line." }],11});12console.log(r.choices[0].message.content);
Streaming
Set stream: true to receive server-sent events as tokens are produced — the same SSE format OpenAI uses, terminated by data: [DONE].
1const stream = await client.chat.completions.create({2model: "llama-3.2-3b-instruct-q4f32_1",3messages: [{ role: "user", content: "Count to five." }],4stream: true,5});67for await (const chunk of stream) {8process.stdout.write(chunk.choices[0]?.delta?.content ?? "");9}
Where to go next
Read the full API reference for every parameter and header, learn the core concepts behind dispatch and credits, or start hosting to earn while you sleep.