OpenAI API Guide

Klintero AI Platform ยท Base URL: http://dev-ai.klintero.com

OpenAI: /v1/*

Authentication

All requests use Authorization: Bearer <API key>.

curl -sS \
  -H "Authorization: Bearer <your-key>" \
  http://dev-ai.klintero.com/v1/models

Missing or invalid keys return 401 Unauthorized with OpenAI-style JSON error payloads.

OpenAI Compatibility Mode

OpenAI-compatible endpoints are available under /v1/*. Use the same SDKs and curl examples by only changing the base URL.

curl -sS \
  -H "Authorization: Bearer <your-key>" \
  -H "Content-Type: application/json" \
  -d '{ "model": "gpt-4.1-mini", "messages": [{ "role": "user", "content": "Hello" }] }' \
  http://dev-ai.klintero.com/v1/chat/completions

Model behavior: model is required. If the model is unknown, the gateway returns model_not_found.

Supported OpenAI paths: /v1/chat/completions, /v1/responses, /v1/embeddings, /v1/models, /v1/jobs/{id}.

Errors on /v1/* follow the OpenAI error object format.

Use /v1/models to list supported model IDs.

Streaming (SSE)

Streaming is supported on /v1/chat/completions and /v1/responses using stream: true.

curl -N -sS \
  -H "Authorization: Bearer <your-key>" \
  -H "Content-Type: application/json" \
  -d '{ "model": "gpt-4.1-mini", "stream": true, "messages": [{ "role": "user", "content": "Hello" }] }' \
  http://dev-ai.klintero.com/v1/chat/completions

If upstream streaming is unavailable, the gateway returns stream_not_supported.

Responses streaming emits response.output_text.delta and response.completed events, then [DONE].

Error Response Shape

{
    "error": {
        "message": "Invalid or missing API key",
        "type": "invalid_request_error",
        "param": null,
        "code": "invalid_api_key"
    }
}

/v1 errors always return error.message, error.type, error.param, error.code.

Endpoints

POST /v1/chat/completions

OpenAI chat completions.

POST /v1/responses

OpenAI responses API.

POST /v1/embeddings

OpenAI embeddings.

GET /v1/models

List supported model IDs.

GET /v1/jobs/{jobId}

Poll async job result.

POST /v1/jobs/{jobId}/cancel

Cancel async job.