API リファレンス

Dolphin Gateway API

The Dolphin Gateway exposes an OpenAI-compatible HTTP API for chat completions. Authenticate with a tenant API key and address models by their tenant-scoped **alias** — the gateway resolves the alias to a backing model on your behalf. The provider, upstream model name, and processing region are never exposed in requests or responses.

Version 1.0.0. This page is generated from the OpenAPI spec; do not edit it by hand.

Servers

Authentication

A tenant API key passed as `Authorization: Bearer <key>`. Keys are scoped; a key must carry the `chat:invoke` scope to call `/v1/chat/completions`.

POST /v1/chat/completions

Create a chat completion

Generate a model response for the supplied conversation. The `model` field is a tenant-scoped **alias**; the gateway resolves it to a backing model. Set `stream: true` to receive the response incrementally as Server-Sent Events (see the streaming note below); otherwise a single JSON completion is returned.

Request body

Content type application/json · schema ChatCompletionRequest

Minimal request

{
  "model": "general",
  "messages": [
    {
      "role": "user",
      "content": "月次レポートの要点を3つにまとめてください。"
    }
  ]
}

With optional parameters

{
  "model": "secure",
  "messages": [
    {
      "role": "system",
      "content": "You are a concise assistant."
    },
    {
      "role": "user",
      "content": "Summarize this contract clause."
    }
  ],
  "max_tokens": 512,
  "temperature": 0.2
}

Responses

200 A chat completion. When `stream` is `false` (or omitted) the body is a single JSON object. When `stream` is `true` the response is an `text/event-stream` of incremental chunks (see the streaming note).

application/json, text/event-stream · schema ChatCompletion

Server-Sent Events. Each `data:` line carries a `chat.completion.chunk` JSON object whose `choices[].delta` holds the incremental content. The stream terminates with a final `data: [DONE]` sentinel.

Non-streaming completion

{
  "id": "chatcmpl-2f8c0b9e-6a1d-4c2e-9b3a-7d5e1f0a2b3c",
  "object": "chat.completion",
  "created": 1718841600,
  "model": "general",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "要点は次の3つです。…"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 42,
    "completion_tokens": 128,
    "total_tokens": 170
  }
}

400 Malformed request (invalid JSON or schema violation).

application/json · schema Error

Example

{
  "error": {
    "type": "invalid_request_error",
    "message": "Invalid chat completion request.",
    "code": "invalid_request"
  }
}

403 The request was refused. Either the API key is not authorized to invoke chat completions, or the content was blocked by a policy.

application/json · schema Error

API key lacks the chat scope

{
  "error": {
    "type": "invalid_request_error",
    "message": "This API key is not authorized to invoke chat completions.",
    "code": "insufficient_scope"
  }
}

Blocked by content policy

{
  "error": {
    "type": "invalid_request_error",
    "message": "Your request was blocked by a content policy.",
    "code": "content_blocked"
  }
}

404 The requested model alias does not exist or is not available to this tenant.

application/json · schema Error

Example

{
  "error": {
    "type": "model_not_found",
    "message": "The requested model was not found.",
    "code": "model_not_found"
  }
}

429 The model alias is temporarily rate limited. Retry with backoff.

application/json · schema Error

Example

{
  "error": {
    "type": "rate_limited",
    "message": "The requested model alias 'general' is temporarily unavailable.",
    "code": "rate_limited"
  }
}

502 The request could not be completed against the backing model.

application/json · schema Error

Example

{
  "error": {
    "type": "upstream_unavailable",
    "message": "The requested model alias 'general' is temporarily unavailable.",
    "code": "upstream_unavailable"
  }
}
GET /v1/models

List available model aliases

Return the model aliases the calling tenant is permitted to use. Each entry is identified by its alias `id`; no provider, upstream model, or region is disclosed.

Responses

200 The list of model aliases available to the tenant.

application/json · schema ModelList

Example

{
  "object": "list",
  "data": [
    {
      "id": "general",
      "object": "model",
      "display_name": "General",
      "description": "汎用的な業務向けアシスタント。"
    },
    {
      "id": "secure",
      "object": "model",
      "display_name": "Secure",
      "description": "機密性の高い業務向けの厳格な構成。"
    }
  ]
}

Schemas

ChatCompletionRequest

FieldTypeReq.Notes
model string required The tenant-scoped model **alias** to invoke (never a provider/model name).
minLength: 1 · e.g. "general", "secure"
messages array<Message> required The conversation so far, oldest first.
minItems: 1
max_tokens integer optional Optional cap on the number of tokens to generate.
min: 1
temperature number optional Optional sampling temperature.
min: 0 · max: 2
stream boolean optional When `true`, the response is streamed as Server-Sent Events (`text/event-stream`) instead of a single JSON object.
default: false

Message

FieldTypeReq.Notes
role string required The author role, e.g. `system`, `user`, or `assistant`.
minLength: 1 · e.g. "user"
content string required The message text.

ChatCompletion

FieldTypeReq.Notes
id string required A gateway-issued completion id (prefixed `chatcmpl-`).
object string required e.g. "chat.completion"
created integer required Unix timestamp (seconds) when the completion was created.
model string required The model **alias** that served the request (echoes the request alias).
choices array<Choice> required
usage Usage required

Choice

FieldTypeReq.Notes
index integer required
message Message required
finish_reason string required Why generation stopped, e.g. `stop` or `length`.

Usage

FieldTypeReq.Notes
prompt_tokens integer required
completion_tokens integer required
total_tokens integer required

ModelList

FieldTypeReq.Notes
object string required e.g. "list"
data array<Model> required

Model

FieldTypeReq.Notes
id string required The model **alias** identifier.
object string required e.g. "model"
display_name string optional A human-readable label for the alias.
nullable
description string optional A short description of the alias.
nullable

Error

FieldTypeReq.Notes
error object required