> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.meshapi.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.meshapi.ai/_mcp/server.

# Embeddings

Most embeddings issues are request-shape or model-capability mismatches. See
[Embeddings](/embeddings) for the full reference.

## 422 — model missing or unsupported field

* `model` is required unless your key has a default model configured.
* `dimensions` only works on models that **support truncation** — sending it to a model that doesn't will be rejected.
* `input_type`, `instructions`, and `sparse_embedding` are provider-specific (e.g. asymmetric models, BytePlus) — a model that doesn't support them may reject the request.

## Results seem mismatched to my inputs

When you pass an array of strings, the returned `data` array is in the **same
order** as your input. Match by `index`, and don't assume the API reorders or
dedupes — it doesn't.

## Input too long

Each model has a `context_length`. Inputs longer than that are rejected — check
the model's `context_length` via `GET /v1/models` and chunk long text before
embedding. *(Behavior inferred from the documented `context_length` field.)*

## Garbled vectors / wrong format

`encoding_format` controls the output: `"float"` returns a numeric array,
`"base64"` returns a packed string you must decode. If your vectors look like
gibberish, you're probably reading `base64` output as floats.

## Still stuck?

See the [Mesh API error reference](/debug/mesh-api#error-code-reference)
or email **[contact@meshapi.ai](mailto:contact@meshapi.ai)**.