Letta · Schema

ChatCompletionRequest

OpenAI-compatible chat completion request - exactly matching OpenAI's schema.

Artificial IntelligenceAgentsStateful AgentsMemoryMemGPTContinual LearningMCPMulti-AgentRAGOpen-Source

Properties

Name Type Description
model string ID of the model to use
messages array Messages comprising the conversation so far
temperature object Sampling temperature
top_p object Nucleus sampling parameter
n object Number of chat completion choices to generate
stream object Whether to stream back partial progress
stop object Sequences where the API will stop generating
max_tokens object Maximum number of tokens to generate
presence_penalty object Presence penalty
frequency_penalty object Frequency penalty
user object A unique identifier representing your end-user
View JSON Schema on GitHub

JSON Schema

letta-chatcompletionrequest-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/ChatCompletionRequest",
  "title": "ChatCompletionRequest",
  "properties": {
    "model": {
      "type": "string",
      "title": "Model",
      "description": "ID of the model to use"
    },
    "messages": {
      "items": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ChatCompletionDeveloperMessageParam"
          },
          {
            "$ref": "#/components/schemas/ChatCompletionSystemMessageParam"
          },
          {
            "$ref": "#/components/schemas/ChatCompletionUserMessageParam"
          },
          {
            "$ref": "#/components/schemas/ChatCompletionAssistantMessageParam"
          },
          {
            "$ref": "#/components/schemas/ChatCompletionToolMessageParam"
          },
          {
            "$ref": "#/components/schemas/ChatCompletionFunctionMessageParam"
          }
        ]
      },
      "type": "array",
      "title": "Messages",
      "description": "Messages comprising the conversation so far"
    },
    "temperature": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 2,
          "minimum": 0
        },
        {
          "type": "null"
        }
      ],
      "title": "Temperature",
      "description": "Sampling temperature"
    },
    "top_p": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 1,
          "minimum": 0
        },
        {
          "type": "null"
        }
      ],
      "title": "Top P",
      "description": "Nucleus sampling parameter"
    },
    "n": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "N",
      "description": "Number of chat completion choices to generate",
      "default": 1
    },
    "stream": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Stream",
      "description": "Whether to stream back partial progress",
      "default": false
    },
    "stop": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Stop",
      "description": "Sequences where the API will stop generating"
    },
    "max_tokens": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Tokens",
      "description": "Maximum number of tokens to generate"
    },
    "presence_penalty": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 2,
          "minimum": -2
        },
        {
          "type": "null"
        }
      ],
      "title": "Presence Penalty",
      "description": "Presence penalty"
    },
    "frequency_penalty": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 2,
          "minimum": -2
        },
        {
          "type": "null"
        }
      ],
      "title": "Frequency Penalty",
      "description": "Frequency penalty"
    },
    "user": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "User",
      "description": "A unique identifier representing your end-user"
    }
  },
  "type": "object",
  "required": [
    "model",
    "messages"
  ],
  "description": "OpenAI-compatible chat completion request - exactly matching OpenAI's schema."
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/letta-chatcompletionrequest"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.