5. Make your first inference call
The API is OpenAI-compatible. Point your existing tooling at Pzero, use your Bearer key, and pick a model from the catalog.
curl
bash
curl -sS -X POST "${PUBLIC_URL}/v1/chat/completions" \
-H "Authorization: Bearer pzero_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "llama-3.3-70b",
"stream": false,
"messages": [{ "role": "user", "content": "Hello from Pzero" }]
}'OpenAI SDK
python
from openai import OpenAI
client = OpenAI(base_url=f"{PUBLIC_URL}/v1", api_key="pzero_YOUR_KEY")
resp = client.chat.completions.create(
model="llama-3.3-70b",
messages=[{"role": "user", "content": "Hello from Pzero"}],
)
print(resp.choices[0].message.content)What happens behind the request
The router selects the cheapest eligible posted offer at or below your max price, forwards once, meters the capacity burn, and settles in USDC with the 10% platform fee.
Notes
- Use a model
idfrom the catalog (GET /v1/models). stream: trueis not supported in v1.- A success response includes an
X-Balance-Remainingheader. - See Errors & limits for
402,429, and503handling.