Letta · Schema

TurnTokenData

Token data for a single LLM generation turn in a multi-turn agent interaction. Used for RL training to track token IDs and logprobs across all LLM calls, not just the final one. Tool results are included so the client can tokenize them with loss_mask=0 (non-trainable).

Artificial IntelligenceAgentsStateful AgentsMemoryMemGPTContinual LearningMCPMulti-AgentRAGOpen-Source

Properties

Name Type Description
role string Role of this turn: 'assistant' for LLM generations (trainable), 'tool' for tool results (non-trainable).
output_ids object Token IDs from SGLang native endpoint. Only present for assistant turns.
output_token_logprobs object Logprobs from SGLang: [[logprob, token_id, top_logprob_or_null], ...]. Only present for assistant turns.
content object Text content. For tool turns, client tokenizes this with loss_mask=0.
tool_name object Name of the tool called. Only present for tool turns.
View JSON Schema on GitHub

JSON Schema

letta-turntokendata-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/TurnTokenData",
  "title": "TurnTokenData",
  "properties": {
    "role": {
      "type": "string",
      "enum": [
        "assistant",
        "tool"
      ],
      "title": "Role",
      "description": "Role of this turn: 'assistant' for LLM generations (trainable), 'tool' for tool results (non-trainable)."
    },
    "output_ids": {
      "anyOf": [
        {
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Output Ids",
      "description": "Token IDs from SGLang native endpoint. Only present for assistant turns."
    },
    "output_token_logprobs": {
      "anyOf": [
        {
          "items": {
            "items": {},
            "type": "array"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Output Token Logprobs",
      "description": "Logprobs from SGLang: [[logprob, token_id, top_logprob_or_null], ...]. Only present for assistant turns."
    },
    "content": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Content",
      "description": "Text content. For tool turns, client tokenizes this with loss_mask=0."
    },
    "tool_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Tool Name",
      "description": "Name of the tool called. Only present for tool turns."
    }
  },
  "type": "object",
  "required": [
    "role"
  ],
  "description": "Token data for a single LLM generation turn in a multi-turn agent interaction.\n\nUsed for RL training to track token IDs and logprobs across all LLM calls,\nnot just the final one. Tool results are included so the client can tokenize\nthem with loss_mask=0 (non-trainable)."
}

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-turntokendata"
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.