# Cortex Bi-Temporal Memory Gateway API

Get Cortex Bi-Temporal Memory Gateway data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Codesphereug, pass parameters such as id, jsonrpc, method, and retrieve structured data including identifier, name, description, returned input schema field, and returned jsonrpc field for application integration and result review, and integration reference.

Documentation: https://openany.si/market/apis/gateway/cortex-bi-temporal-memory-gateway/
API ID: ec1ba258-f646-4dfb-b882-b8d387c25d23
Provider: codesphereug
Contract revision: 6
Method: POST
Endpoint: https://api.openany.si/v1/agent-apis/codesphereug/cortex/mcp
Page update time: 2026-12-03T02:49:50.561Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: application/json
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.001 / call
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract. Price update time: not supplied.
Contract update time: 2026-12-03T02:49:50.561Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "1000",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Cortex Bi-Temporal Memory Gateway API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {}
    },
    "headers": {
      "type": "object",
      "properties": {}
    },
    "body": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers",
    "body"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "jsonrpc": {
      "type": "string"
    },
    "result": {
      "type": "object",
      "properties": {
        "tools": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "description": {
                "type": "string"
              },
              "inputSchema": {
                "type": "object",
                "properties": {
                  "properties": {
                    "type": "object",
                    "properties": {
                      "category": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "enum": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "content": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "entities_mentioned": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string"
                              }
                            }
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "files_touched": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string"
                              }
                            }
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "timestamp": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "title": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "confidence": {
                        "type": "object",
                        "properties": {
                          "default": {
                            "type": "number"
                          },
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "object_id": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "object_value": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "predicate": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "singular": {
                        "type": "object",
                        "properties": {
                          "default": {
                            "type": "boolean"
                          },
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "source_episode_id": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "subject_id": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "valid_from": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "as_of": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "include_superseded": {
                        "type": "object",
                        "properties": {
                          "default": {
                            "type": "boolean"
                          },
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "max_tokens": {
                        "type": "object",
                        "properties": {
                          "default": {
                            "type": "integer"
                          },
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "query": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "entity_id": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "max_hops": {
                        "type": "object",
                        "properties": {
                          "default": {
                            "type": "integer"
                          },
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "auto_resolve": {
                        "type": "object",
                        "properties": {
                          "default": {
                            "type": "boolean"
                          },
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "type": {
                    "type": "string"
                  }
                }
              },
              "name": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
```

## Request example
Scenario: Recorded upstream MCP tools/list (HTTP 200)
```bash
curl \
  'https://api.openany.si/v1/agent-apis/codesphereug/cortex/mcp' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "id": 2,
  "jsonrpc": "2.0",
  "method": "tools/list"
}'
```

## Response example
Published documentation example. Verify the actual response after an approved call.
Sample response · Documented HTTP 200
```json
{
  "id": 2,
  "jsonrpc": "2.0",
  "result": {
    "tools": [
      {
        "description": "Record an immutable engineering episode (ADR, bug_root_cause, invariant, session_note, migration, incident) with associated files and mentioned entities.",
        "inputSchema": {
          "properties": {
            "category": {
              "description": "Episode classification category.",
              "enum": [
                "adr",
                "bug_root_cause",
                "incident",
                "invariant",
                "migration",
                "session_note"
              ],
              "type": "string"
            },
            "content": {
              "description": "Detailed architectural or technical note.",
              "type": "string"
            },
            "entities_mentioned": {
              "description": "Canonical entity IDs referenced in this episode.",
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "files_touched": {
              "description": "Relative repository file paths involved.",
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timestamp": {
              "description": "Optional ISO-8601 UTC timestamp.",
              "type": "string"
            },
            "title": {
              "description": "Short descriptive title of the episode.",
              "type": "string"
            }
          },
          "required": [
            "title",
            "category",
            "content"
          ],
          "type": "object"
        },
        "name": "memory_record_episode"
      },
      {
        "description": "Record a structured entity-relationship fact (subject_id, predicate, object) with automatic bi-temporal conflict detection and supersession of stale facts.",
        "inputSchema": {
          "properties": {
            "confidence": {
              "default": 1.0,
              "description": "Confidence score in [0.0, 1.0].",
              "type": "number"
            },
            "object_id": {
              "description": "Target entity identifier (if relational).",
              "type": "string"
            },
            "object_value": {
              "description": "Target literal value (if attribute).",
              "type": "string"
            },
            "predicate": {
              "description": "Relationship or attribute predicate.",
              "type": "string"
            },
            "singular": {
              "default": true,
              "description": "If true, supersedes any prior active fact with the same (subject_id, predicate).",
              "type": "boolean"
            },
            "source_episode_id": {
              "description": "Optional episode ID that established this fact.",
              "type": "string"
            },
            "subject_id": {
              "description": "Source entity identifier.",
              "type": "string"
            },
            "valid_from": {
              "description": "Optional ISO-8601 UTC timestamp when fact became true.",
              "type": "string"
            }
          },
          "required": [
            "subject_id",
            "predicate"
          ],
          "type": "object"
        },
        "name": "memory_upsert_fact"
      },
      {
        "description": "Compile a token-budgeted, provenance-cited context bundle for a coding query, automatically suppressing superseded/stale facts.",
        "inputSchema": {
          "properties": {
            "as_of": {
              "description": "Optional ISO-8601 timestamp for point-in-time compilation.",
              "type": "string"
            },
            "include_superseded": {
              "default": false,
              "description": "Whether to include historically superseded facts.",
              "type": "boolean"
            },
            "max_tokens": {
              "default": 1200,
              "description": "Strict maximum token budget for the compiled context.",
              "type": "integer"
            },
            "query": {
              "description": "Task description, symbol, or file query.",
              "type": "string"
            }
          },
          "required": [
            "query"
          ],
          "type": "object"
        },
        "name": "memory_compile_context"
      },
      {
        "description": "Inspect an entity's active facts, superseded historical facts, related episodes, and K-hop ego-graph neighborhood.",
        "inputSchema": {
          "properties": {
            "entity_id": {
              "description": "Entity ID to inspect.",
              "type": "string"
            },
            "include_superseded": {
              "default": true,
              "description": "Include historical facts superseded by newer decisions.",
              "type": "boolean"
            },
            "max_hops": {
              "default": 2,
              "description": "Maximum hop distance for ego-graph traversal.",
              "type": "integer"
            }
          },
          "required": [
            "entity_id"
          ],
          "type": "object"
        },
        "name": "memory_query_entity"
      },
      {
        "description": "Query the knowledge graph as of a specific ISO-8601 timestamp to inspect historical architecture state.",
        "inputSchema": {
          "properties": {
            "as_of": {
              "description": "ISO-8601 UTC timestamp to inspect.",
              "type": "string"
            }
          },
          "required": [
            "as_of"
          ],
          "type": "object"
        },
        "name": "memory_time_travel"
      },
      {
        "description": "Verify cryptographic SHA-256 hashes of all episodes and facts and compute the graph Merkle digest.",
        "inputSchema": {
          "properties": {},
          "type": "object"
        },
        "name": "memory_verify_integrity"
      },
      {
        "description": "Scan active facts in the bi-temporal graph to detect unresolved logical contradictions (negation polarity inversions, antonym objects, predicate alias collisions, or unsuperseded multi-value drift) and recommend or apply supersession resolutions.",
        "inputSchema": {
          "properties": {
            "as_of": {
              "description": "Optional ISO-8601 timestamp to audit active facts at a historical point.",
              "type": "string"
            },
            "auto_resolve": {
              "default": false,
              "description": "If true, automatically supersedes the older/lower-confidence conflicting fact.",
              "type": "boolean"
            }
          },
          "type": "object"
        },
        "name": "cortex_audit_contradictions"
      }
    ]
  }
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
