Create embeddings (PydanticAI - Cohere format)

Creates embeddings using Cohere-compatible format via PydanticAI.

POST
/pydanticai/cohere/v2/embed
AuthorizationBearer <token>

Bearer token authentication. Use your MPilot virtual-key JWT or admin JWT. Virtual keys (prefixed with sk-bf-) can also be passed here.

In: header

modelstring

ID of an available embedding model

input_typestring

Specifies the type of input passed to the model. Required for embedding models v3 and higher.

texts?array<string>

Array of strings to embed. Maximum 96 texts per call. At least one of texts, images, or inputs is required.

Itemsitems <= 96
images?array<string>

Array of image data URIs for multimodal embedding. Maximum 1 image per call. Supports JPEG, PNG, WebP, GIF up to 5MB.

Itemsitems <= 1
inputs?array<object>

Array of mixed text/image components for embedding. Maximum 96 per call.

Itemsitems <= 96
embedding_types?array<string>

Specifies the return format types (float, int8, uint8, binary, ubinary, base64). Defaults to float if unspecified.

output_dimension?integer

Number of dimensions for output embeddings (256, 512, 1024, 1536). Available only for embed-v4 and newer models.

max_tokens?integer

Maximum tokens to embed per input before truncation.

truncate?string

Handling for inputs exceeding token limits. Defaults to END.

Response Body

curl -X POST "https://loading/{AI_GATEWAY_URL}/pydanticai/cohere/v2/embed" \  -H "Content-Type: application/json" \  -d '{    "model": "embed-english-v3.0",    "input_type": "string"  }'
{
  "id": "string",
  "embeddings": {
    "float": [
      [
        0
      ]
    ],
    "int8": [
      [
        0
      ]
    ],
    "uint8": [
      [
        0
      ]
    ],
    "binary": [
      [
        0
      ]
    ],
    "ubinary": [
      [
        0
      ]
    ],
    "base64": [
      "string"
    ]
  },
  "response_type": "string",
  "texts": [
    "string"
  ],
  "images": [
    {
      "width": 0,
      "height": 0,
      "format": "string",
      "bit_depth": 0
    }
  ],
  "meta": {
    "api_version": {
      "version": "string",
      "is_deprecated": true,
      "is_experimental": true
    },
    "billed_units": {
      "input_tokens": 0,
      "output_tokens": 0,
      "search_units": 0,
      "classifications": 0
    },
    "tokens": {
      "input_tokens": 0,
      "output_tokens": 0
    },
    "warnings": [
      "string"
    ]
  }
}
{
  "type": "string",
  "message": "string",
  "code": "string"
}
{
  "type": "string",
  "message": "string",
  "code": "string"
}
On this page

On this page

No Headings