Skip to content

Developer docs

AITREE speaks the OpenAI API. For most SDKs you only change base_url and api_key.

Base URL

https://api.aitree.ai/v1

Quickstart · APIキー取得

Authentication

Send a Bearer token in the Authorization header. Create and manage keys in the console.

Chat completions

Same parameters as OpenAI /v1/chat/completions, including streaming.

curl https://api.aitree.ai/v1/chat/completions \
  -H "Authorization: Bearer $AITREE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-flash-0731",
    "messages": [{"role":"user","content":"Hello"}],
    "stream": true
  }'

List models

Discover the models currently available to your key.

curl https://api.aitree.ai/v1/models \
  -H "Authorization: Bearer $AITREE_API_KEY"

Errors

Error responses follow the OpenAI shape; error.type identifies the origin.

Compatibility

Works with the official OpenAI SDKs, LangChain, LlamaIndex, Cherry Studio, Open WebUI, Cursor and anything else that accepts a custom base_url.

Python

from openai import OpenAI

client = OpenAI(
    base_url="https://api.aitree.ai/v1",
    api_key="AITREE_API_KEY",
)

resp = client.chat.completions.create(
    model="deepseek-v4-flash-0731",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)

Works with the official OpenAI SDKs, LangChain, LlamaIndex, Cherry Studio, Open WebUI, Cursor and anything else that accepts a custom base_url.