Wire Protocol Compatibility

OpenAI SDK with DEVUP AI

Connect standard OpenAI client libraries directly to DEVUP AI. Our platform provides full wire-format compatibility with OpenAI's REST endpoints, allowing developers to route chat completions, vector embeddings, streaming tokens, and model listings to open-source foundation models simply by updating the base URL and API key.

System Architecture

How OpenAI Clients Connect to DEVUP AI

DEVUP AI exposes a wire-compatible API gateway at https://api.devupai.com/v1. When an OpenAI SDK client makes an HTTP request, our gateway authenticates your DEVUP AI token via standard Bearer authorization, verifies local DZD balance, and dispatches inference directly to your requested foundation model.

1. Client
OpenAI SDK
TypeScript, Python, cURL
2. Gateway
DEVUP AI API
https://api.devupai.com/v1
3. Routing
Proxy & Auth
Bearer token & DZD balance
4. Response
OpenAI Wire Format
JSON & SSE streams

Client Configuration

Quickstart in JavaScript, TypeScript & Python

TS

TypeScript & JavaScript (Official openai npm package)

Install the official package and configure baseURL:

bash
npm install openai
typescript
import OpenAI from "openai";

const openai = new OpenAI({
  apiKey: process.env.DEVUP_API_KEY,
  baseURL: "https://api.devupai.com/v1",
});

async function main() {
  const completion = await openai.chat.completions.create({
    model: "deepseek-ai/DeepSeek-V4-Pro",
    messages: [{ role: "user", content: "Hello from DEVUP AI!" }],
  });

  console.log(completion.choices[0].message.content);
}

main();
PY

Python (Official openai PyPI package)

Install via pip and point the base_url parameter to DEVUP AI:

bash
pip install openai
python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("DEVUP_API_KEY"),
    base_url="https://api.devupai.com/v1",
)

response = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4-Pro",
    messages=[{"role": "user", "content": "Hello from DEVUP AI!"}],
)

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

Endpoint Coverage

Verified OpenAI-Compatible Endpoints

The following endpoints are actively implemented and tested in the DEVUP AI gateway:

EndpointMethodCapabilityStatus
/v1/chat/completionsPOSTChat completions, streaming deltas, function tools, multi-turnFully Supported
/v1/embeddingsPOSTSingle and batch vector generation for embeddingsFully Supported
/v1/modelsGETModel catalogue listing in OpenAI standard formatFully Supported
/v1/audio/transcriptionsPOSTSpeech-to-text audio transcriptions (Whisper API schema)Fully Supported
/v1/images/generationsPOSTImage generation prompt processing with signed media URLsFully Supported

Real-Time Streaming

Token-by-Token Server-Sent Events (SSE)

Pass stream: true to receive incremental token updates as Server-Sent Events, significantly reducing time to first token for interactive applications:

TypeScript / JavaScript Streaming

typescript
const stream = await openai.chat.completions.create({
  model: "deepseek-ai/DeepSeek-V4-Pro",
  messages: [{ role: "user", content: "Write a short poem." }],
  stream: true,
});

for await (const chunk of stream) {
  const content = chunk.choices[0]?.delta?.content;
  if (content) {
    process.stdout.write(content);
  }
}

Python Streaming

python
stream = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4-Pro",
    messages=[{"role": "user", "content": "Write a short poem."}],
    stream=True,
)

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

Security & Billing

Authentication & Local DZD Billing

Standard Bearer Auth

Every request authenticates using standard HTTP Authorization Bearer tokens. When initializing the OpenAI client, pass your DEVUP AI API key directly via apiKey or environment variables.

Authorization: Bearer sk-devup-...

Metered DZD Billing

All requests across chat, embeddings, and audio are billed in Algerian Dinar (DZD) based on token or duration usage. Top up balances directly via Edahabia or CIB cards without foreign currency constraints.

Local currency · Edahabia & CIB support

Start Building with the OpenAI SDK

Get your API key, configure your base URL, and leverage production foundation models in seconds.