Langdock Agent API

The Agent API from Langdock — 2 operation(s) for agent.

OpenAPI Specification

langdock-agent-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Langdock Agent API
  version: 3.0.0
servers:
- url: https://api.langdock.com
  description: Production
security:
- bearerAuth: []
tags:
- name: Agent
paths:
  /agent/v1/chat/completions:
    post:
      tags:
      - Agent
      summary: Creates a chat completion with an agent (Vercel AI SDK compatible)
      description: Creates a model response using Vercel AI SDK compatible UIMessage format
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            examples:
              streamingEnabled:
                summary: Request with streaming enabled
                value:
                  agentId: agent_123
                  messages:
                  - id: msg_1
                    role: user
                    parts:
                    - type: text
                      text: Hello, how can you help me?
                  stream: true
            schema:
              type: object
              oneOf:
              - type: object
                required:
                - agentId
                - messages
                properties:
                  agentId:
                    type: string
                    description: ID of an existing agent to use
                  messages:
                    type: array
                    description: Array of UIMessage objects (Vercel AI SDK format)
                    items:
                      type: object
                      required:
                      - id
                      - role
                      - parts
                      properties:
                        id:
                          type: string
                          description: Unique message identifier
                        role:
                          type: string
                          enum:
                          - user
                          - assistant
                          - system
                          - tool
                        parts:
                          type: array
                          items:
                            type: object
                            required:
                            - type
                            properties:
                              type:
                                type: string
                                enum:
                                - text
                                - file
                                - tool-invocation
                                - tool-result
                              text:
                                type: string
                                description: Text content for text parts
                              url:
                                type: string
                                description: File URL for file parts
                              name:
                                type: string
                                description: File name
                              mimeType:
                                type: string
                                description: MIME type of the file
                              toolCallId:
                                type: string
                                description: Tool call identifier
                              toolName:
                                type: string
                                description: Name of the tool
                              args:
                                type: object
                                description: Tool arguments
                              result:
                                type: object
                                description: Tool result
                  stream:
                    type: boolean
                    default: false
                  output:
                    $ref: '#/components/schemas/StructuredOutputConfig'
                  imageResponseFormat:
                    type: string
                    enum:
                    - url
                    - b64_json
                    description: Response format for images generated by the agent. "url" returns a signed URL, "b64_json" returns base64-encoded image data.
      responses:
        '200':
          description: Successful chat completion
          content:
            application/json:
              schema:
                type: object
                description: UIMessage response (Vercel AI SDK format)
                required:
                - id
                - role
                - parts
                properties:
                  id:
                    type: string
                  role:
                    type: string
                    enum:
                    - assistant
                  parts:
                    type: array
                    items:
                      type: object
                  output:
                    description: Structured output if requested
        '400':
          description: Invalid request parameters
        '429':
          description: Rate limit exceeded
        '500':
          description: Internal server error
  /agent/v1/models:
    get:
      tags:
      - Agent
      summary: Lists the available models
      description: Returns a list of models that are available for use with the API.
      parameters: []
      responses:
        '200':
          description: List of available models
          content:
            application/json:
              schema:
                type: object
                required:
                - object
                - data
                properties:
                  object:
                    type: string
                    enum:
                    - list
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        object:
                          type: string
                        created:
                          type: integer
                        owned_by:
                          type: string
components:
  schemas:
    StructuredOutputConfig:
      type: object
      description: Specification for structured output format. When type is object/array and no schema is provided, the response will be JSON but can have any structure. When the type is enum, you must provide an enum parameter with an array of strings as options.
      properties:
        type:
          type: string
          enum:
          - object
          - array
          - enum
          description: The type of structured output
        schema:
          type: object
          description: JSON Schema definition for the output (required for object/array types with specific structure). Search for "JSON to JSON Schema" in the web to find a tool to convert any JSON into the required JSON Schema format.
        enum:
          type: array
          items:
            type: string
          description: Array of allowed values (required for enum type). Values must be of type string.
      oneOf:
      - properties:
          type:
            enum:
            - enum
          enum:
            type: array
            items:
              type: string
      - properties:
          type:
            enum:
            - object
            - array
          schema:
            type: object
      - properties:
          type:
            enum:
            - object
            - array
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key as Bearer token. Format "Bearer YOUR_API_KEY"