openapi: 3.2.0 info: title: LiteLLM memory management API description: 'Proxy Server to call 100+ LLMs in the OpenAI format. **Customize Swagger Docs** 👉 ```LiteLLM Admin Panel on /ui```. Create, Edit Keys with SSO. Having issues? Try ```Fallback Login``` 💸 ```LiteLLM Model Cost Map```. 🔎 ```LiteLLM Model Hub```. See available models on the proxy. **Docs**' version: 1.102.1 tags: - name: memory management paths: /v1/memory: post: tags: - memory management summary: Create Memory description: Create a new memory entry for the caller (or, for admins, any scope). operationId: create_memory_v1_memory_post security: - APIKeyHeader: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/MemoryCreateRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/LiteLLM_MemoryRow' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' get: tags: - memory management summary: List Memory description: List memory entries visible to the caller. operationId: list_memory_v1_memory_get security: - APIKeyHeader: [] parameters: - name: key in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by exact key match. title: Key description: Filter by exact key match. - name: key_prefix in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by key prefix (Redis-style namespace scan). Mutually exclusive with `key`; if both are provided, `key_prefix` wins. title: Key Prefix description: Filter by key prefix (Redis-style namespace scan). Mutually exclusive with `key`; if both are provided, `key_prefix` wins. - name: search in: query required: false schema: anyOf: - type: string - type: 'null' description: Match entries whose key starts with this value or whose memory_id equals it. Takes precedence over `key_prefix` and `key` when provided. title: Search description: Match entries whose key starts with this value or whose memory_id equals it. Takes precedence over `key_prefix` and `key` when provided. - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 500 minimum: 1 default: 50 title: Page Size responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/MemoryListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/memory/{key}: get: tags: - memory management summary: Get Memory description: Get a single memory entry by key, scoped to the caller. operationId: get_memory_v1_memory__key__get security: - APIKeyHeader: [] parameters: - name: key in: path required: true schema: type: string title: Key responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/LiteLLM_MemoryRow' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' put: tags: - memory management summary: Upsert Memory description: 'Upsert a memory entry by key within the caller''s scope. If no row exists for (key, caller.user_id, caller.team_id), create one. If one exists, update the value/metadata fields that were provided.' operationId: upsert_memory_v1_memory__key__put security: - APIKeyHeader: [] parameters: - name: key in: path required: true schema: type: string title: Key requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/MemoryUpdateRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/LiteLLM_MemoryRow' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' delete: tags: - memory management summary: Delete Memory description: Delete a memory entry by key, scoped to the caller. operationId: delete_memory_v1_memory__key__delete security: - APIKeyHeader: [] parameters: - name: key in: path required: true schema: type: string title: Key responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/MemoryDeleteResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: MemoryUpdateRequest: properties: value: anyOf: - type: string - type: 'null' title: Value metadata: anyOf: - {} - type: 'null' title: Metadata user_id: anyOf: - type: string - type: 'null' title: User Id team_id: anyOf: - type: string - type: 'null' title: Team Id type: object title: MemoryUpdateRequest MemoryCreateRequest: properties: key: type: string title: Key description: Memory key (acts as the namespace in the URL). value: type: string title: Value description: Memory content. Typically markdown/text for LLM context. metadata: anyOf: - {} - type: 'null' title: Metadata description: Optional JSON metadata (tags, structured fields). user_id: anyOf: - type: string - type: 'null' title: User Id description: Scope to this user. Defaults to the caller's user_id. team_id: anyOf: - type: string - type: 'null' title: Team Id description: Scope to this team. Defaults to the caller's team_id. type: object required: - key - value title: MemoryCreateRequest LiteLLM_MemoryRow: properties: memory_id: type: string title: Memory Id key: type: string title: Key value: type: string title: Value metadata: anyOf: - {} - type: 'null' title: Metadata user_id: anyOf: - type: string - type: 'null' title: User Id team_id: anyOf: - type: string - type: 'null' title: Team Id created_at: anyOf: - type: string format: date-time - type: 'null' title: Created At created_by: anyOf: - type: string - type: 'null' title: Created By updated_at: anyOf: - type: string format: date-time - type: 'null' title: Updated At updated_by: anyOf: - type: string - type: 'null' title: Updated By type: object required: - memory_id - key - value title: LiteLLM_MemoryRow MemoryDeleteResponse: properties: key: type: string title: Key deleted: type: boolean title: Deleted type: object required: - key - deleted title: MemoryDeleteResponse ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context type: object required: - loc - msg - type title: ValidationError MemoryListResponse: properties: memories: items: $ref: '#/components/schemas/LiteLLM_MemoryRow' type: array title: Memories total: type: integer title: Total type: object required: - memories - total title: MemoryListResponse HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError securitySchemes: APIKeyHeader: type: apiKey description: Bearer token in: header name: x-litellm-api-key