Quickstart

1. Get a key

Sign in at pirol.ai/console and create a key under API keys. It starts with ep_live_ and is shown once. Store it where you keep your other secrets; it is not recoverable afterwards.

A key from the console draws on the credit you top up in the console. See authentication for what that means when the credit runs out.

2. Ask something

curl https://endpoint.pirol.ai/v1/chat/completions \
  -H "Authorization: Bearer $PIROL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "pirol/pirol-ai",
    "messages": [{"role": "user", "content": "Say hello in one sentence."}]
  }'

The answer is an OpenAI chat completion:

{
  "id": "chatcmpl-…",
  "object": "chat.completion",
  "model": "pirol/pirol-ai",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Hello — good to meet you." },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 14, "completion_tokens": 9, "total_tokens": 23 }
}

3. Use it from your code

Any OpenAI client works. Point it at the endpoint:

from openai import OpenAI

client = OpenAI(
    base_url="https://endpoint.pirol.ai/v1",
    api_key=os.environ["PIROL_API_KEY"],
)

answer = client.chat.completions.create(
    model="pirol/pirol-ai",
    messages=[{"role": "user", "content": "Say hello in one sentence."}],
)
print(answer.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://endpoint.pirol.ai/v1",
  apiKey: process.env.PIROL_API_KEY,
});

const answer = await client.chat.completions.create({
  model: "pirol/pirol-ai",
  messages: [{ role: "user", content: "Say hello in one sentence." }],
});

Next