Prerequisites
- A Poixe account
- An API key
Call the API
- cURL
- TypeScript
- Python
- Golang
1
Set your API key
Get your API key from the Poixe dashboard and set it as an environment variable:
export POIXE_API_KEY='your-api-key-here'
2
Make your first API call
Run this command to send your first Poixe API request:Example output:
curl https://api.poixe.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $POIXE_API_KEY" \
-d '{
"model": "gpt-5.2",
"messages": [
{
"role": "user",
"content": "Hello!"
}
]
}'
{
"id": "chatcmpl-Cvjc7QFlcx3QrvEd7lysmzU849xQf",
"object": "chat.completion",
"created": 1767876071,
"model": "gpt-5.2-2025-12-11",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hi—what can I help you with today?",
"refusal": null,
"annotations": []
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 13,
"total_tokens": 20,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"service_tier": "default",
"system_fingerprint": null
}
1
Set your API key
Get your API key from the Poixe dashboard and set it as an environment variable:
export POIXE_API_KEY='your-api-key-here'
2
Install the SDK
Install the OpenAI TypeScript SDK:
npm install openai
3
Create your code
Save this as
quickstart.ts:import OpenAI from "openai";
const openai = new OpenAI({
apiKey: process.env.POIXE_API_KEY!,
baseURL: "https://api.poixe.com/v1",
});
async function main() {
const completion = await openai.chat.completions.create({
model: "gpt-5.2",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "Hello!" },
],
});
console.log(completion.choices[0].message.content);
}
main();
4
Run your code
npx tsx quickstart.ts
Hello! How can I help you today?
1
Set your API key
Get your API key from the Poixe dashboard and set it as an environment variable:
export POIXE_API_KEY='your-api-key-here'
2
Install the SDK
Install the OpenAI Python SDK:
pip install openai
3
Create your code
Save this as
quickstart.py:import os
from openai import OpenAI
api_key = os.environ.get("POIXE_API_KEY")
client = OpenAI(api_key=api_key, base_url="https://api.poixe.com/v1")
completion = client.chat.completions.create(
model="gpt-5.2",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Write a short bedtime story about a unicorn."},
],
)
print(completion.choices[0].message.content)
4
Run your code
python quickstart.py
Hello! How can I help today?
1
Set your API key
Get your API key from the Poixe dashboard and set it as an environment variable:
export POIXE_API_KEY='your-api-key-here'
2
Initialize a Go module (optional)
If you are working in a new directory, initialize a Go module first:
mkdir poixe-go-quickstart && cd poixe-go-quickstart
go mod init main
3
Install the SDK
Install the OpenAI-compatible Go SDK (go-openai):
go get github.com/sashabaranov/go-openai
4
Create your code
Save this as
main.go:package main
import (
"context"
"fmt"
"os"
"github.com/sashabaranov/go-openai"
)
func main() {
apiKey := os.Getenv("POIXE_API_KEY")
if apiKey == "" {
fmt.Println("POIXE_API_KEY is not set")
os.Exit(1)
}
cfg := openai.DefaultConfig(apiKey)
cfg.BaseURL = "https://api.poixe.com/v1"
client := openai.NewClientWithConfig(cfg)
resp, err := client.CreateChatCompletion(
context.Background(),
openai.ChatCompletionRequest{
Model: "gpt-5.2",
Messages: []openai.ChatCompletionMessage{
{
Role: openai.ChatMessageRoleSystem,
Content: "You are a helpful assistant.",
},
{
Role: openai.ChatMessageRoleUser,
Content: "Hello!",
},
},
},
)
if err != nil {
fmt.Printf("ChatCompletion error: %v", err)
return
}
fmt.Println(resp.Choices[0].Message.Content)
}
5
Run your code
go run main.go
Hello! What can I help you with today?