logoPofano

Your First API Request

Make your first API call to Pofano in minutes.

Overview#

This guide walks you through making your first API call to Pofano. You'll learn the base URL, authentication, and how to send a chat completion request.

Base URL#

All API requests use the following base URL:

https://ai.pofano.com

Chat Completions Example#

Using curl#

curl https://ai.pofano.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {"role": "user", "content": "Hello, how are you?"}
    ]
  }'

Using Python#

import requests

headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
}

data = {
    "model": "gpt-4o",
    "messages": [
        {"role": "user", "content": "Hello, how are you?"}
    ]
}

response = requests.post(
    "https://ai.pofano.com/v1/chat/completions",
    headers=headers,
    json=data
)

print(response.json())

Using JavaScript (fetch)#

const response = await fetch("https://ai.pofano.com/v1/chat/completions", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
  },
  body: JSON.stringify({
    model: "gpt-4o",
    messages: [
      { role: "user", content: "Hello, how are you?" }
    ]
  })
});

const data = await response.json();
console.log(data);

What's Next#

On this page