LangDB website screenshot

LangDB

LangDB is an AI gateway and governance platform that routes requests across 250+ models from providers such as OpenAI, Anthropic, Google, Meta, Mistral, and DeepSeek through a single project-scoped, OpenAI-compatible REST API. It layers routing, guardrails, tracing, cost control, and an MCP (Model Context Protocol) gateway on top of that unified interface.

7 APIs 0 Features
AILLMAI GatewayRoutingGovernanceMCP

APIs

LangDB Chat Completions / Routing API

OpenAI-compatible chat completions routed across 250+ models from OpenAI, Anthropic, Google, Meta, Mistral, and DeepSeek, with SSE streaming, tool calling, structured outputs, f...

LangDB Embeddings API

OpenAI-compatible embeddings endpoint that creates vector representations of input text or token arrays via any embedding model routed through the gateway.

LangDB Images API

OpenAI-compatible image generation endpoint producing images from text prompts using image-capable models routed through the gateway.

LangDB Models API

Lists the models available to a project through the gateway in an OpenAI-compatible shape, spanning 250+ models across the supported providers.

LangDB Threads / Messages API

Retrieves the ordered messages and aggregated per-thread cost for a conversation thread, grouped by the X-Thread-Id supplied on chat requests.

LangDB Analytics / Usage API

Returns time-series analytics, aggregated summaries, total usage, and per-model usage (cost and token counts) for a project over preset reporting windows.

LangDB MCP Gateway API

Attaches virtual and custom MCP servers (over SSE or WebSocket transport) to chat requests via the mcp_servers array, exposing their tools to the routed model and bundling multi...

Collections

Pricing Plans

Langdb Plans Pricing

4 plans

PLANS

Rate Limits

Langdb Rate Limits

5 limits

RATE LIMITS

FinOps

Langdb Finops

FINOPS

Event Specifications

LangDB Chat Completions Streaming (HTTP + SSE)

AsyncAPI 2.6 description of LangDB's **chat completion streaming** surface. LangDB does not publish a WebSocket API for chat. The asynchronous / event-style transport documented...

ASYNCAPI

Resources

👥
GitHubOrganization
GitHubOrganization
🔗
LinkedIn
LinkedIn
🔗
Website
Website
🔗
Documentation
Documentation
🔗
Plans
Plans
🔗
RateLimits
RateLimits
🔗
FinOps
FinOps

Sources

Raw ↑
opencollection: 1.0.0
info:
  name: LangDB AI Gateway API
  version: '1.0'
request:
  auth:
    type: bearer
    token: '{{bearerToken}}'
items:
- info:
    name: Chat
    type: folder
  items:
  - info:
      name: Create a chat completion
      type: http
    http:
      method: POST
      url: https://api.us-east-1.langdb.ai/{{projectId}}/v1/chat/completions
      body:
        type: json
        data: "{\n  \"model\": \"openai/gpt-4o-mini\",\n  \"messages\": [\n    { \"role\": \"user\", \"content\": \"Hello\"\
          \ }\n  ],\n  \"stream\": false\n}"
    docs: 'OpenAI-compatible chat completion routed across 250+ models. Set stream=true for Server-Sent Events. Optional headers:
      X-Project-Id, X-Thread-Id, X-Run-Id, X-Label.'
- info:
    name: Embeddings
    type: folder
  items:
  - info:
      name: Create embeddings
      type: http
    http:
      method: POST
      url: https://api.us-east-1.langdb.ai/{{projectId}}/v1/embeddings
      body:
        type: json
        data: "{\n  \"model\": \"openai/text-embedding-3-small\",\n  \"input\": \"The quick brown fox\"\n}"
    docs: Creates an embedding vector representing the input text or token array.
- info:
    name: Images
    type: folder
  items:
  - info:
      name: Create an image
      type: http
    http:
      method: POST
      url: https://api.us-east-1.langdb.ai/{{projectId}}/v1/images/generations
      body:
        type: json
        data: "{\n  \"model\": \"openai/gpt-image-1\",\n  \"prompt\": \"a red butterfly on warm paper\",\n  \"n\": 1,\n  \"\
          size\": \"1024x1024\"\n}"
    docs: Generates one or more images from a text prompt using an image-capable model.
- info:
    name: Models
    type: folder
  items:
  - info:
      name: List models
      type: http
    http:
      method: GET
      url: https://api.us-east-1.langdb.ai/{{projectId}}/v1/models
    docs: Lists the models available to the project through the gateway.
- info:
    name: Threads
    type: folder
  items:
  - info:
      name: Get messages for a thread
      type: http
    http:
      method: GET
      url: https://api.us-east-1.langdb.ai/threads/{{threadId}}/messages
    docs: Retrieves the ordered messages belonging to a conversation thread.
  - info:
      name: Get the cost of a thread
      type: http
    http:
      method: GET
      url: https://api.us-east-1.langdb.ai/threads/{{threadId}}/cost
    docs: Returns the aggregated cost and token usage for a conversation thread.
- info:
    name: Analytics
    type: folder
  items:
  - info:
      name: Fetch analytics data
      type: http
    http:
      method: POST
      url: https://api.us-east-1.langdb.ai/analytics
      body:
        type: json
        data: "{\n  \"interval\": \"last_month\"\n}"
    docs: Returns time-series analytics for the project over a preset interval.
  - info:
      name: Fetch analytics summary
      type: http
    http:
      method: POST
      url: https://api.us-east-1.langdb.ai/analytics/summary
      body:
        type: json
        data: "{\n  \"interval\": \"last_month\"\n}"
    docs: Returns an aggregated analytics summary for the requested window.
  - info:
      name: Get total usage
      type: http
    http:
      method: POST
      url: https://api.us-east-1.langdb.ai/usage/total
      body:
        type: json
        data: "{\n  \"interval\": \"last_month\"\n}"
    docs: Returns total usage (cost, input tokens, output tokens) for the project.
  - info:
      name: Get usage by model
      type: http
    http:
      method: POST
      url: https://api.us-east-1.langdb.ai/usage/models
      body:
        type: json
        data: "{\n  \"interval\": \"last_month\"\n}"
    docs: Returns usage broken down per model for the project.