Quickstart
Use a key from the console with the standard OpenAI-compatible API. The examples use placeholders; do not paste a real key into source code or a browser application.
Prepare
- Create a dedicated API key in the console.
- Use
https://1pkapi.com/v1as the base URL. - Get an applicable model ID from
GET /v1/modelsfor the current key.
Send a short curl request
curl https://1pkapi.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "your-model-id",
"messages": [{"role": "user", "content": "Reply with one word: ready"}]
}'Use the Python OpenAI SDK
from openai import OpenAI
import os
client = OpenAI(
api_key=os.environ["ONEPK_API_KEY"],
base_url="https://1pkapi.com/v1",
)
response = client.chat.completions.create(
model="your-model-id",
messages=[{"role": "user", "content": "Reply with one word: ready"}],
)
print(response.choices[0].message.content)Verify before expanding
First confirm one short, non-streaming request. Then configure streaming or higher concurrency in the application. For a 401, 429, or availability error, collect the time, model, status code, and a redacted error message before retrying.
A model ID, price, and availability can vary by key and service state. Check the console and current model list before a production rollout.
