codai Memory API

Your persistent memory: the facts, preferences and decisions codai remembers across sessions and tools. The same store the MCP memory tools use, scoped to your account (and to the app when the key was minted for one). Needs a plan with persistent memory (`403 memory_not_enabled` otherwise); `503 memory_unavailable` when memory is not configured on the gateway. Search and create embed the text once each and appear in your usage as `memory:search` / `memory:create`.

GitHub OpenAPI

Operations 5

GET /v1/memory List your memories #
POST /v1/memory Store a memory #
DELETE /v1/memory Delete all your memories #
GET /v1/memory/search Search your memories #
DELETE /v1/memory/{id} Delete a memory #

Work with this as data

Every API 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 apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • 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 API
curl "https://apis.io/api/v1/apis/codai-ro:codai-ro-memory-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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.

OpenAPI Specification

codai-ro-memory-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Codai Ro Memory API
  version: '1'
  description: 'Operations tagged Memory across 2 of this provider''s published API definitions: codai-ro-gateway-openapi.json, codai-ro-gateway-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://ai.codai.ro
  description: Production
security:
- bearerAuth: []
tags:
- name: Memory
  description: 'Your persistent memory: the facts, preferences and decisions codai remembers across sessions and tools. The same store

    the MCP memory tools use, scoped to your account (and to the app when the key was minted for one). Needs a plan with

    persistent memory (`403 memory_not_enabled` otherwise); `503 memory_unavailable` when memory is not configured on the

    gateway. Search and create embed the text once each and appear in your usage as `memory:search` / `memory:create`.'
paths:
  /v1/memory:
    get:
      operationId: listMemories
      tags:
      - Memory
      summary: List your memories
      description: Your memories, newest first, optionally limited to one tier. Listing does not embed anything and is not metered.
      parameters:
      - $ref: '#/components/parameters/RequestId'
      - name: tier
        in: query
        required: false
        description: Only this memory tier.
        schema:
          type: string
          enum:
          - semantic
          - episodic
          - procedural
          - graph
      - name: limit
        in: query
        required: false
        description: Page size.
        schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 20
      - name: offset
        in: query
        required: false
        description: Records to skip.
        schema:
          type: integer
          minimum: 0
          default: 0
      responses:
        '200':
          description: One page of memories and the total count.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          description: The key plan has no persistent memory (code `memory_not_enabled`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: The memory store failed for this request (code `memory_error`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Memory is not configured on this gateway (code `memory_unavailable`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: createMemory
      tags:
      - Memory
      summary: Store a memory
      description: Stores one semantic memory (a fact or preference). Embeds the content once (metered as `memory:create`).
      parameters:
      - $ref: '#/components/parameters/RequestId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - content
              properties:
                content:
                  type: string
                  minLength: 1
                  maxLength: 4000
                  description: The fact to remember, one clear sentence.
                importance:
                  type: number
                  minimum: 0
                  maximum: 1
                  default: 0.6
                  description: Importance from 0 to 1.
      responses:
        '201':
          description: Stored; the new memory id.
          content:
            application/json:
              schema:
                type: object
                required:
                - id
                properties:
                  id:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          description: The key plan has no persistent memory (code `memory_not_enabled`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: The memory store failed for this request (code `memory_error`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Memory is not configured on this gateway (code `memory_unavailable`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      operationId: deleteAllMemories
      tags:
      - Memory
      summary: Delete all your memories
      description: Erases EVERY memory of the key's account (all tiers, quarantined records included). Needs the explicit confirmation `confirm=all` (query) or `{"confirm":"all"}` (body), otherwise `400` with code `confirm_required`. Always allowed, also on plans without persistent memory; does not call a model.
      parameters:
      - $ref: '#/components/parameters/RequestId'
      - name: confirm
        in: query
        required: false
        description: Must be `all`.
        schema:
          type: string
          enum:
          - all
      responses:
        '200':
          description: Erased; counts per tier and the total.
          content:
            application/json:
              schema:
                type: object
                required:
                - deleted
                - total
                properties:
                  deleted:
                    type: object
                    additionalProperties:
                      type: integer
                  total:
                    type: integer
        '400':
          description: Missing confirmation (code `confirm_required`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          description: The memory store failed for this request (code `memory_error`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Memory is not configured on this gateway (code `memory_unavailable`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    servers:
    - url: https://ai.codai.ro
      description: Production
  /v1/memory/search:
    get:
      operationId: searchMemories
      tags:
      - Memory
      summary: Search your memories
      description: 'Semantic recall over your memories: the most relevant first, with a relevance score between 0 and 1. Embeds the query once (metered as `memory:search`).'
      parameters:
      - $ref: '#/components/parameters/RequestId'
      - name: q
        in: query
        required: true
        description: What to look for (natural language).
        schema:
          type: string
          minLength: 1
          maxLength: 2000
      - name: limit
        in: query
        required: false
        description: Maximum number of results.
        schema:
          type: integer
          minimum: 1
          maximum: 10
          default: 5
      responses:
        '200':
          description: Matching memories, most relevant first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemorySearchResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          description: The key plan has no persistent memory (code `memory_not_enabled`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: The memory store failed for this request (code `memory_error`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Memory is not configured on this gateway (code `memory_unavailable`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    servers:
    - url: https://ai.codai.ro
      description: Production
  /v1/memory/{id}:
    delete:
      operationId: deleteMemory
      tags:
      - Memory
      summary: Delete a memory
      description: Deletes one of your memories. An unknown id, or one that belongs to another account, is `404`; nothing is deleted.
      parameters:
      - $ref: '#/components/parameters/RequestId'
      - name: id
        in: path
        required: true
        description: Memory id (from list or search).
        schema:
          type: string
          maxLength: 128
      responses:
        '200':
          description: Deleted.
          content:
            application/json:
              schema:
                type: object
                required:
                - deleted
                properties:
                  deleted:
                    type: boolean
                    const: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          description: The key plan has no persistent memory (code `memory_not_enabled`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          description: The memory store failed for this request (code `memory_error`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Memory is not configured on this gateway (code `memory_unavailable`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    servers:
    - url: https://ai.codai.ro
      description: Production
components:
  schemas:
    MemoryList:
      type: object
      required:
      - memories
      - total
      properties:
        memories:
          type: array
          items:
            $ref: '#/components/schemas/MemoryItem'
        total:
          type: integer
          minimum: 0
          description: Total memories matching the filter.
    MemorySearchResult:
      type: object
      required:
      - memories
      properties:
        memories:
          type: array
          items:
            $ref: '#/components/schemas/MemoryHit'
    Error:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - message
          - type
          - code
          properties:
            message:
              type: string
              description: Human-readable, provider names redacted.
            type:
              type: string
              enum:
              - invalid_request_error
              - subscription_required
              - rate_limit_error
              - upstream_error
              - server_error
            code:
              type: string
              enum:
              - bad_request
              - invalid_api_key
              - subscription_inactive
              - forbidden
              - not_found
              - payload_too_large
              - rate_limit_exceeded
              - quota_exceeded
              - upstream_error
              - internal_error
              - not_a_member
              - lease_held
              - seq_conflict
              - host_offline
              - host_timeout
              - rules_refused
              - search_unavailable
              - task_not_confirmable
              - slug_taken
              - project_has_environments
              - already_has_env
              - not_enrollable
              - not_byo
              - invalid_transition
              - already_member
              - vm_per_dev_single_member
              - last_owner
              - insufficient_balance
              - key_scope_forbidden
              - assets_unavailable
              - asset_not_found
              - too_many_renders
              - renders_unavailable
              - timeline_too_long
              - not_a_timeline
              - invalid_cursor
              - templates_unavailable
              - url_blocked
              - invalid_tokens
              - unsupported_media
              - kind_mismatch
              - node_not_found
              - invalid_pick
              - duplicate_key
              - unknown_var
              - invalid_var_value
              - unsupported_kind
              - too_long
              - stale
              - not_supported_for_kind
              - unsupported_format
              - too_large
              - not_implemented
              - version_conflict
              - settings_unavailable
              - ai_label_required
              - sandbox_concurrency_limit
              - sandbox_busy
              - sandbox_daily_limit
              - invalid_ttl
              - workspace_too_large
              - sandbox_paused_limit
              - sandbox_capacity
            details:
              description: Present on `bad_request` (flattened Zod field errors), `invalid_tokens` (`issues`) and `rules_refused` (`tool`, `rule_id`, `decision`). Other codes never forward details over HTTP.
              type: object
              additionalProperties: true
      examples:
      - error:
          message: Invalid or missing API key.
          type: invalid_request_error
          code: invalid_api_key
    MemoryHit:
      type: object
      description: One search result.
      required:
      - id
      - tier
      - content
      - relevance
      properties:
        id:
          type: string
        tier:
          type: string
          enum:
          - semantic
          - episodic
          - procedural
          - graph
        content:
          type: string
        relevance:
          type: number
          minimum: 0
          maximum: 1
          description: Relevance from 0 to 1, rounded to 3 decimals.
    MemoryItem:
      type: object
      description: One stored memory.
      required:
      - id
      - tier
      - content
      - importance
      - createdAt
      properties:
        id:
          type: string
        tier:
          type: string
          enum:
          - semantic
          - episodic
          - procedural
          - graph
        content:
          type: string
        importance:
          type: number
          minimum: 0
          maximum: 1
          description: Importance from 0 to 1, rounded to 2 decimals.
        createdAt:
          type: string
          format: date-time
          description: When the memory was stored (ISO 8601).
  responses:
    Unauthorized:
      description: Missing, malformed, revoked or paused API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PaymentRequired:
      description: The subscription behind this key is inactive.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: No such resource, or it belongs to another account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Malformed body or query; `details` holds the flattened field errors.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    RequestId:
      name: x-request-id
      in: header
      required: false
      description: Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row.
      schema:
        type: string
        maxLength: 128
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: codai_…
      description: A codai API key (`codai_` prefix). Ephemeral tokens from `POST /v1/tokens` are accepted only by the media surfaces matching their scope (`/v1/realtime`, `/v1/audio/*`, `/v1/embeddings`).
x-refined-from:
- codai-ro-gateway-openapi.json
- codai-ro-gateway-openapi.yml