AI21 Labs Library API

The Library API from AI21 Labs — 1 operation(s) for library.

OpenAPI Specification

ai21-labs-library-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: AI21 Studio Chat Library API
  version: 1.0.0
  description: REST API for AI21 Labs covering Jamba chat completions, AI21 Maestro planning runs, and the managed File Library for RAG workflows. Authentication is Bearer token via the Authorization header.
  contact:
    name: AI21 Labs
    url: https://docs.ai21.com/
servers:
- url: https://api.ai21.com
  description: Production
security:
- BearerAuth: []
tags:
- name: Library
paths:
  /studio/v1/library/files:
    get:
      tags:
      - Library
      summary: List documents in the file library
      parameters:
      - name: name
        in: query
        schema:
          type: string
      - name: status
        in: query
        schema:
          type: string
      - name: labels
        in: query
        schema:
          type: string
      responses:
        '200':
          description: File list
    post:
      tags:
      - Library
      summary: Upload a file to the library
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - file
              properties:
                file:
                  type: string
                  format: binary
                labels:
                  type: array
                  items:
                    type: string
                publicUrl:
                  type: string
      responses:
        '200':
          description: File uploaded; returns UUID
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer API key in Authorization header.