> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Phaseo Gateway base URL: https://api.phaseo.app/v1. Send `Authorization: Bearer $PHASEO_API_KEY` with every request.
> Model IDs look like `provider/model`, for example `openai/gpt-6-astra`. Do not guess IDs: list them with `GET /v1/models` or check https://phaseo.app/models. `phaseo/free` routes to an available free model and needs no wallet balance.
> For new text integrations prefer `POST /v1/responses`. `POST /v1/chat/completions` (OpenAI format) and `POST /v1/messages` (Anthropic format) suit existing code.
> The full API contract is https://phaseo.app/docs/openapi/v1/openapi.yaml. Official SDKs: `@phaseo/sdk` (TypeScript) and `phaseo` (Python), plus Go, C#, PHP, Ruby and Rust.
> Search these docs over MCP at https://phaseo.app/docs/mcp, and install Phaseo skills with `npx skills add https://phaseo.app/docs`. If a page is wrong or out of date, report it with the MCP `submit_feedback` tool.
> Manage Phaseo accounts with the `phaseo` CLI (`npm install -g @phaseo/cli`, then `phaseo login` or `phaseo login --device-code`), the `/v1` Management API or the MCP server at `https://mcp.phaseo.app/mcp?access=manage`. Do not send users to the dashboard for account tasks. A person is still needed for sign-up, approving a sign-in, paying the first top-up on the checkout link that `phaseo credits add` returns when no card is saved, confirming each saved-card top-up from the emailed link, and account security (password, MFA, passkeys). Create API keys with `phaseo keys create --name <name> --json`; never guess one. Credit top-ups need `phaseo login --scopes billing:write` first. Task map: https://phaseo.app/docs/v1/developers/manage-from-an-agent.md.

# Create embeddings

> Create embeddings with the Phaseo embeddings endpoint.



## OpenAPI

````yaml openapi/v1/openapi.yaml POST /embeddings
openapi: 3.0.3
info:
  title: Phaseo Gateway API
  description: >-
    A gateway API for accessing various AI models with OpenAI-compatible
    endpoints.
  version: 1.0.0
  contact:
    name: Phaseo
    url: https://phaseo.app
    email: danielbutler500@gmail.com
servers:
  - url: https://api.phaseo.app/v1
    description: Global routing
security:
  - BearerAuth: []
tags:
  - name: Gateway
    description: Core Phaseo Gateway operations.
paths:
  /embeddings:
    post:
      tags:
        - Gateway
      summary: Create embeddings
      description: Creates an embedding vector representing the input text.
      operationId: createEmbedding
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingsRequest'
      responses:
        '200':
          description: Embeddings response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingsResponse'
components:
  schemas:
    EmbeddingsRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
        models:
          $ref: '#/components/schemas/ModelFallbacks'
        input:
          oneOf:
            - type: string
            - type: array
              items:
                type: integer
            - $ref: '#/components/schemas/EmbeddingsMultimodalInput'
            - type: array
              items:
                oneOf:
                  - type: string
                  - type: array
                    items:
                      type: integer
                  - $ref: '#/components/schemas/EmbeddingsMultimodalInput'
        encoding_format:
          type: string
          enum:
            - float
            - base64
        dimensions:
          type: integer
          minimum: 1
        provider_options:
          type: object
          properties:
            google:
              type: object
              properties:
                task_type:
                  type: string
                  pattern: ^[A-Z_]+$
                title:
                  type: string
            mistral:
              type: object
              properties:
                output_dtype:
                  type: string
                  enum:
                    - float
                    - int8
                    - uint8
                    - binary
                    - ubinary
        user:
          type: string
        debug:
          $ref: '#/components/schemas/DebugOptions'
        provider:
          $ref: '#/components/schemas/ProviderRoutingOptions'
    EmbeddingsResponse:
      type: object
      properties:
        object:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/Embedding'
        model:
          type: string
        usage:
          $ref: '#/components/schemas/Usage'
    ModelFallbacks:
      type: array
      minItems: 1
      maxItems: 25
      items:
        type: string
        minLength: 1
      description: >-
        Optional ordered fallback models tried after `model`. `model` is
        required and is always the primary model. When an attempt fails with
        `429`, `500`, `502`, `503`, or `504`, the next entry is tried; other
        errors are returned unchanged. Accepts up to 25 model IDs or presets;
        duplicates and entries equal to `model` are ignored. Each attempt is
        validated, logged, and billed as its own request, and the response
        `model` field and routing trace show the model that served the request.
        Streaming requests fall back only before the first byte, and video and
        music jobs fall back only at submission. Batch, realtime, and council
        requests reject `models`. Fallbacks set on a dynamic route take
        precedence, and `phaseo/auto` cannot be combined with `models`.
      example:
        - anthropic/claude-sonnet-5-5
        - google/gemini-2.5-flash
    EmbeddingsMultimodalInput:
      type: object
      description: Google multimodal embeddings extension item.
      required:
        - content
      properties:
        content:
          type: array
          minItems: 1
          items:
            oneOf:
              - type: object
                required:
                  - type
                  - text
                properties:
                  type:
                    type: string
                    enum:
                      - text
                      - input_text
                  text:
                    type: string
              - type: object
                required:
                  - type
                properties:
                  type:
                    type: string
                    enum:
                      - image_url
                      - input_image
                      - image
                  image_url:
                    oneOf:
                      - type: string
                      - type: object
                        required:
                          - url
                        properties:
                          url:
                            type: string
                  url:
                    oneOf:
                      - type: string
                      - type: object
                        required:
                          - url
                        properties:
                          url:
                            type: string
                anyOf:
                  - required:
                      - image_url
                  - required:
                      - url
              - type: object
                required:
                  - type
                  - input_audio
                properties:
                  type:
                    type: string
                    enum:
                      - input_audio
                  input_audio:
                    type: object
                    properties:
                      data:
                        type: string
                      url:
                        type: string
                      format:
                        type: string
                    anyOf:
                      - required:
                          - data
                      - required:
                          - url
              - type: object
                required:
                  - type
                properties:
                  type:
                    type: string
                    enum:
                      - input_video
                      - video_url
                  video_url:
                    oneOf:
                      - type: string
                      - type: object
                        required:
                          - url
                        properties:
                          url:
                            type: string
                  url:
                    oneOf:
                      - type: string
                      - type: object
                        required:
                          - url
                        properties:
                          url:
                            type: string
                anyOf:
                  - required:
                      - video_url
                  - required:
                      - url
    DebugOptions:
      type: object
      description: Gateway debug controls. These flags are never forwarded upstream.
      properties:
        enabled:
          type: boolean
        return_upstream_request:
          type: boolean
        return_upstream_response:
          type: boolean
        trace:
          type: boolean
        trace_level:
          type: string
          enum:
            - summary
            - full
    ProviderRoutingOptions:
      type: object
      description: Provider routing preferences for gateway selection.
      properties:
        order:
          type: array
          items:
            type: string
        only:
          type: array
          items:
            type: string
        ignore:
          type: array
          items:
            type: string
        include_alpha:
          type: boolean
          description: Include alpha providers in routing (off by default).
        allow_fallbacks:
          type: boolean
          nullable: true
          description: Allow fallback to another eligible provider after failure.
        require_parameters:
          type: boolean
          nullable: true
          description: Require provider support for requested parameters before routing.
        required_execution_region:
          type: string
          nullable: true
          description: Restrict routing to providers with the requested execution region.
        required_data_region:
          type: string
          nullable: true
          description: Restrict routing to providers with the requested data region.
        require_zero_data_retention:
          type: boolean
          nullable: true
          description: Restrict routing to providers that support zero data retention.
        data_collection:
          type: string
          nullable: true
          description: >-
            `allow` (the default) filters nothing. `deny` is not supported yet
            and returns 400 unsupported_routing_filter.
          enum:
            - allow
            - deny
        zdr:
          type: boolean
          nullable: true
        enforce_distillable_text:
          type: boolean
          nullable: true
          description: >-
            `false` (the default) filters nothing. `true` is not supported yet
            and returns 400 unsupported_routing_filter.
        quantizations:
          type: array
          nullable: true
          items:
            type: string
        sort:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
          description: >-
            Rank providers for this request, for example by price, latency, or
            throughput.
        max_price:
          type: object
          properties:
            prompt:
              oneOf:
                - type: number
                - type: string
            completion:
              oneOf:
                - type: number
                - type: string
            image:
              oneOf:
                - type: number
                - type: string
            audio:
              oneOf:
                - type: number
                - type: string
            request:
              oneOf:
                - type: number
                - type: string
        preferred_min_throughput:
          oneOf:
            - type: number
            - type: object
              additionalProperties:
                type: number
        preferred_max_latency:
          oneOf:
            - type: number
            - type: object
              additionalProperties:
                type: number
    Embedding:
      type: object
      properties:
        object:
          type: string
        embedding:
          type: array
          items:
            type: number
        index:
          type: integer
    Usage:
      type: object
      properties:
        prompt_tokens:
          type: integer
          description: Input tokens, including cache reads and cache writes.
        prompt_tokens_details:
          $ref: '#/components/schemas/InputTokensDetails'
        completion_tokens:
          type: integer
        input_tokens:
          type: integer
          description: Input tokens, including cache reads and cache writes.
        input_tokens_details:
          $ref: '#/components/schemas/InputTokensDetails'
        output_tokens:
          type: integer
        total_tokens:
          type: integer
        server_tool_use:
          $ref: '#/components/schemas/ServerToolUsage'
        cost:
          type: number
          format: double
          description: >-
            What the request costs you, in US dollars: the amount charged to
            your credits, the same figure as `cost_nanos`, after any
            data-sharing discount or zero-output waiver. Returned on Chat
            Completions, Responses, Messages and embeddings responses once the
            request is priced. On a stream it is on the final usage frame (on
            Messages, the final `message_delta`) and covers the whole stream. A
            stream leaves it out when the charge is not known as that frame is
            sent: on a BYOK stream, whose service fee is worked out when the
            stream ends (`cost_details.upstream_inference_cost` gives the model
            price instead), and on a stream that has already failed, which is
            not charged.
          example: 0.001234567
        cost_details:
          $ref: '#/components/schemas/UsageCostDetails'
    InputTokensDetails:
      type: object
      description: Breakdown of the input tokens.
      properties:
        cached_tokens:
          type: integer
          description: Input tokens read from the provider's prompt cache.
        cache_write_tokens:
          type: integer
          description: Input tokens written to the provider's prompt cache.
        cache_write_tokens_details:
          $ref: '#/components/schemas/CacheWriteTokensDetails'
    ServerToolUsage:
      type: object
      properties:
        datetime_requests:
          type: integer
          minimum: 0
        web_search_requests:
          type: integer
          minimum: 0
        subagent_requests:
          type: integer
          minimum: 0
        fusion_requests:
          type: integer
          minimum: 0
        search_models_requests:
          type: integer
          minimum: 0
        web_fetch_requests:
          type: integer
          minimum: 0
        advisor_requests:
          type: integer
          minimum: 0
        image_generation_requests:
          type: integer
          minimum: 0
        apply_patch_requests:
          type: integer
          minimum: 0
      additionalProperties: false
    UsageCostDetails:
      type: object
      description: Breakdown of the request's cost.
      properties:
        upstream_inference_cost:
          type: number
          format: double
          nullable: true
          description: >-
            On a BYOK request, what the provider charges your own key for the
            inference, in US dollars, at the model's listed prices. Null when
            the request runs on Phaseo credits, where `cost` is the whole
            charge.
          example: null
    CacheWriteTokensDetails:
      type: object
      description: >-
        Cache writes split by lifetime, on Responses usage from OpenAI GPT-5.6
        and later. The two counts sum to cache_write_tokens. Not returned in
        Chat Completions prompt_tokens_details.
      properties:
        ttl_30m_tokens:
          type: integer
          description: >-
            Input tokens written to the cache with a 30-minute lifetime, billed
            at 1.25x the input rate.
        ttl_12h_tokens:
          type: integer
          description: >-
            Input tokens written to the cache with a 12-hour lifetime, billed at
            2.5x the input rate.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.