Skip to main content

OpenAI

Integrate OpenAI models through the Adaline Proxy to automatically capture telemetry — requests, responses, token usage, latency, and costs — with minimal code changes.

Supported Models

Chat Models
ModelDescription
gpt-5.3-codexLatest Codex model
gpt-5.2-proLatest flagship model
gpt-5.2High capability next-gen model
gpt-5.2-codexGPT-5.2 Codex
chatgpt-5.2ChatGPT 5.2
gpt-5.2-chat-latestGPT-5.2 chat latest snapshot
gpt-5.1Next-gen model
gpt-5GPT-5 series base
gpt-5-miniCompact GPT-5
gpt-5-nanoUltra-compact GPT-5
gpt-5-chat-latestGPT-5 chat latest snapshot
gpt-4.1Improved GPT-4 with enhanced reasoning
gpt-4.1-miniCompact GPT-4.1
gpt-4.1-nanoUltra-compact GPT-4.1
gpt-4oMultimodal with vision support
gpt-4o-2024-08-06GPT-4o August 2024 snapshot
gpt-4o-2024-05-13GPT-4o May 2024 snapshot
chatgpt-4o-latestChatGPT-4o latest snapshot
gpt-4o-miniFast and cost-effective multimodal
gpt-4o-mini-2024-07-18GPT-4o Mini July 2024 snapshot
gpt-4-turboHigh capability with 128k context
gpt-4-turbo-2024-04-09GPT-4 Turbo April 2024 snapshot
gpt-4-turbo-previewGPT-4 Turbo preview
gpt-4Original GPT-4 model
gpt-4-0613GPT-4 June 2023 snapshot
gpt-4-0125-previewGPT-4 January 2024 preview
gpt-4-1106-previewGPT-4 November 2023 preview
gpt-3.5-turboFast and cost-effective
gpt-3.5-turbo-0125GPT-3.5 Turbo January 2024 snapshot
gpt-3.5-turbo-1106GPT-3.5 Turbo November 2023 snapshot
o4-miniLatest compact reasoning model
o4-mini-2025-04-16O4 Mini April 2025 snapshot
o3Advanced reasoning model
o3-2025-04-16O3 April 2025 snapshot
o3-miniCompact reasoning model
o3-mini-2025-01-31O3 Mini January 2025 snapshot
o1Reasoning model for complex tasks
o1-2024-12-17O1 December 2024 snapshot
Embedding Models
ModelDescription
text-embedding-3-largeHighest quality embeddings
text-embedding-3-smallBalanced quality and cost
text-embedding-ada-002Legacy embedding model

Proxy Base URL

https://gateway.adaline.ai/v1/openai/

Prerequisites

  1. An OpenAI API key
  2. An Adaline API key, project ID, and prompt ID

Chat Completions

Complete Chat

from openai import OpenAI

client = OpenAI(
    api_key="your-openai-api-key",
    base_url="https://gateway.adaline.ai/v1/openai/"
)

headers = {
    "adaline-api-key": "your-adaline-api-key",
    "adaline-project-id": "your-project-id",
    "adaline-prompt-id": "your-prompt-id"
}

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "What is machine learning?"}
    ],
    extra_headers=headers
)

print(response.choices[0].message.content)

Stream Chat

from openai import OpenAI

client = OpenAI(
    api_key="your-openai-api-key",
    base_url="https://gateway.adaline.ai/v1/openai/"
)

headers = {
    "adaline-api-key": "your-adaline-api-key",
    "adaline-project-id": "your-project-id",
    "adaline-prompt-id": "your-prompt-id"
}

stream = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Explain quantum computing in simple terms."}
    ],
    stream=True,
    stream_options={"include_usage": True},
    extra_headers=headers
)

for chunk in stream:
    if chunk.choices[0].delta.content is not None:
        print(chunk.choices[0].delta.content, end="")

Embeddings

from openai import OpenAI

client = OpenAI(
    api_key="your-openai-api-key",
    base_url="https://gateway.adaline.ai/v1/openai/"
)

headers = {
    "adaline-api-key": "your-adaline-api-key",
    "adaline-project-id": "your-project-id",
    "adaline-prompt-id": "your-prompt-id"
}

response = client.embeddings.create(
    model="text-embedding-3-small",
    input="The quick brown fox jumps over the lazy dog",
    extra_headers=headers
)

embedding = response.data[0].embedding
print(f"Embedding dimension: {len(embedding)}")

Optional Headers

Customize tracing behavior with optional headers:
headers = {
    # Required
    "adaline-api-key": "your-adaline-api-key",
    "adaline-project-id": "your-project-id",
    "adaline-prompt-id": "your-prompt-id",
    # Optional
    "adaline-trace-name": "openai-chat-completion",
    "adaline-trace-session-id": "user-session-123",
    "adaline-span-name": "gpt-4o-call",
    "adaline-trace-tags": '["production", "chat"]',
    "adaline-trace-attributes": '{"create": {"userId": "user-123"}}',
}
See the full Headers Reference for all available options.

Next Steps


Back to Integrations

Browse all integrations