BETA
Documentation
Quick Start
From zero to a working chat completion in under five minutes, with the official Python SDK.
1. Install
terminal
pip install openai2. Initialize
main.py
from openai import OpenAI
client = OpenAI(
api_key="apily_your-api-key", # created on the API page in your account
base_url="https://apily.pro/v1", # Apily base URL
)3. Minimal chat
main.py
response = client.chat.completions.create(
model="gpt-5.6-sol", # any id from GET /v1/models
messages=[
{"role": "user", "content": "Introduce the API in one sentence"},
],
)
print(response.choices[0].message.content)Or with plain cURL, no SDK required:
terminal
curl https://apily.pro/v1/chat/completions \
-H "Authorization: Bearer apily_your-api-key" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-sol","messages":[{"role":"user","content":"ping"}]}'4. About the response
- Success — HTTP 200, an OpenAI-compatible JSON body with a
choicesarray. - Failure — HTTP 4xx/5xx with an
errorfield (see HTTP Status Codes).
5. Notes
base_urlmust include/v1— dropping it turns every call into a404.- Model ids come from the Apily catalog (
GET /v1/modelsor the Models page) and may differ from the raw provider id. - For token-by-token output, set
stream=True— see Python SDK Streaming.