{
  "openapi": "3.0.3",
  "info": {
    "title": "Tuatara Embed Stocks",
    "version": "1.0",
    "description": "Vector embeddings of listed stock symbols and of text, in one 4,096-dimension space. Built for the connections a sector label does not carry: which symbols a news story, a theme or an event moves, including companies the text never names. Send sym:TICKER (for example sym:AAPL) to get that listed symbol's own vector; any other input is embedded as text. Compare a headline with candidate symbols by cosine to build the basket a fund or trade setup needs. OpenAI embeddings shape (POST /embeddings), so any OpenAI-compatible client works. Zero data retention: request and response bodies are not stored. Evidence: https://cymetica.com/static/research/tuatara-embed-stocks-symbols/summary.json",
    "contact": {
      "name": "Cymetica",
      "url": "https://cymetica.com",
      "email": "contact@cymetica.com"
    },
    "termsOfService": "https://cymetica.com/terms",
    "license": {
      "name": "Proprietary"
    }
  },
  "servers": [
    {
      "url": "https://cymetica.com/api/v1/embed/v1",
      "description": "Production (Japan)"
    }
  ],
  "tags": [
    {"name": "Embeddings", "description": "Vectors for stock symbols and text"},
    {"name": "Account", "description": "Usage and service status"}
  ],
  "security": [{"bearer": []}, {"apiKey": []}],
  "paths": {
    "/embeddings": {
      "post": {
        "tags": ["Embeddings"],
        "operationId": "embeddings",
        "summary": "Vectors for stock symbols (sym:TICKER) or text",
        "description": "OpenAI embeddings request. The same call works at https://cymetica.com/api/v1/embeddings for clients that take one base URL. A symbol is written sym:TICKER; anything else is text. Vectors are unit length; a text with no known word is the zero vector.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/EmbeddingsRequest"},
              "examples": {
                "headline_vs_symbols": {
                  "summary": "A headline and candidate symbols in one call",
                  "value": {
                    "model": "tuatara-embed-stocks-1",
                    "input": ["Chipmakers rally as hyperscalers raise capex guidance", "sym:NVDA", "sym:AMD", "sym:XOM"],
                    "encoding_format": "float"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OpenAI embeddings list",
            "headers": {
              "X-RapidAPI-Billing": {
                "description": "Only on RapidAPI: TokenBlocks=<n>, one unit per further started 20,000 tokens after the first block",
                "schema": {"type": "string"}
              }
            },
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/EmbeddingsResponse"}
              }
            }
          },
          "400": {"$ref": "#/components/responses/Error"},
          "401": {"$ref": "#/components/responses/Error"},
          "404": {"$ref": "#/components/responses/Error"},
          "413": {"$ref": "#/components/responses/Error"},
          "429": {"$ref": "#/components/responses/RateLimited"},
          "503": {"$ref": "#/components/responses/Error"}
        }
      }
    },
    "/models": {
      "get": {
        "tags": ["Account"],
        "operationId": "models",
        "summary": "The embedding model documents",
        "security": [],
        "responses": {
          "200": {
            "description": "Model documents (OpenRouter provider schema 2.4)",
            "content": {"application/json": {"schema": {"type": "object"}}}
          }
        }
      }
    },
    "/usage": {
      "get": {
        "tags": ["Account"],
        "operationId": "usage",
        "summary": "Requests and tokens used by this key",
        "parameters": [
          {"name": "days", "in": "query", "schema": {"type": "integer", "default": 30, "minimum": 1, "maximum": 90}}
        ],
        "responses": {
          "200": {
            "description": "Usage by day (counts only)",
            "content": {"application/json": {"schema": {"type": "object"}}}
          },
          "401": {"$ref": "#/components/responses/Error"}
        }
      }
    },
    "/health": {
      "get": {
        "tags": ["Account"],
        "operationId": "health",
        "summary": "Service status and uptime",
        "security": [],
        "responses": {
          "200": {
            "description": "Status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "model": {"type": "string"},
                    "models": {"type": "object", "additionalProperties": {"type": "boolean"}},
                    "served": {"type": "boolean"},
                    "zero_data_retention": {"type": "boolean"}
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {"type": "http", "scheme": "bearer", "description": "Authorization: Bearer <key>"},
      "apiKey": {"type": "apiKey", "in": "header", "name": "X-Api-Key"}
    },
    "responses": {
      "Error": {
        "description": "Error (OpenAI shape)",
        "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
      },
      "RateLimited": {
        "description": "More than the key's requests a minute (60 by default; free self-serve keys 30 a minute, 600 an hour, 5,000 a day); retry after the Retry-After seconds",
        "headers": {"Retry-After": {"schema": {"type": "integer"}}},
        "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
      }
    },
    "schemas": {
      "EmbeddingsRequest": {
        "type": "object",
        "required": ["model", "input"],
        "properties": {
          "model": {
            "type": "string",
            "enum": ["tuatara-embed-stocks-1", "tuatara-embed-stocks-latest"],
            "default": "tuatara-embed-stocks-1"
          },
          "input": {
            "description": "One string or up to 256 strings, each at most 8,000 characters. sym:TICKER is a listed symbol's own vector (sym:AAPL); anything else is embedded as text.",
            "oneOf": [
              {"type": "string"},
              {"type": "array", "items": {"type": "string"}, "minItems": 1, "maxItems": 256}
            ]
          },
          "dimensions": {"type": "integer", "enum": [4096], "description": "Only 4096 is served"},
          "encoding_format": {"type": "string", "enum": ["float", "base64"], "default": "float", "description": "base64 is float32 little-endian"}
        }
      },
      "EmbeddingsResponse": {
        "type": "object",
        "properties": {
          "object": {"type": "string", "enum": ["list"]},
          "model": {"type": "string"},
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {"type": "string", "enum": ["embedding"]},
                "index": {"type": "integer"},
                "embedding": {
                  "description": "4,096 floats, or a base64 string when encoding_format is base64",
                  "oneOf": [{"type": "array", "items": {"type": "number"}}, {"type": "string"}]
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "prompt_tokens": {"type": "integer", "description": "Word tokens across the inputs; the billed unit"},
              "total_tokens": {"type": "integer"}
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {"type": "string"},
              "type": {"type": "string"},
              "code": {"type": "string"},
              "param": {"type": "string", "nullable": true}
            }
          }
        }
      }
    }
  }
}
