---
title: "Create embeddings (OpenAI-compatible)"
description: "OpenAI's embeddings API. input is a string or an array of strings (token-ID arrays are refused with token_input_unsupported); dimensions truncates the vectors (Matryoshka), within the model's minDimensions and dimensions; encoding_format is float (the default) or base64. user is accepted and ignored. Errors use OpenAI's body, with the platform's stable code in error.code."
---

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

Path: Inference API

`POST /v1/organizations/{orgId}/projects/{projectId}/openai/v1/embeddings`

OpenAI's embeddings API. input is a string or an array of strings (token-ID arrays are refused with token_input_unsupported); dimensions truncates the vectors (Matryoshka), within the model's minDimensions and dimensions; encoding_format is float (the default) or base64. user is accepted and ignored. Errors use OpenAI's body, with the platform's stable code in error.code.

## Authentication

Requires one of the following:

- `apiKey`, http, header `Authorization`
- `oauth`, http, header `Authorization`

## Path parameters

- `CreateEmbeddings.path.orgId` (string, required)
  - format `uuid`
- `CreateEmbeddings.path.projectId` (string, required)
  - format `uuid`

## Request body

_Required._

- `CreateEmbeddings.input` (one of, required) — The text to embed: a string, or an array of 1 to the model's maxInputs strings. Empty strings are refused.
  - one of: `string`, `array<string>`
- `CreateEmbeddings.model` (string, required) — A catalog model ID, or <id>:<version>.
- `CreateEmbeddings.dimensions` (integer, optional) — The vectors' length, from the model's minDimensions to its dimensions.
- `CreateEmbeddings.encoding_format` (string, optional)
  - one of `"float"`, `"base64"`; default `"float"`
- `CreateEmbeddings.user` (string, optional) — Accepted and ignored; never stored or forwarded.

## Example request

```json
{
  "dimensions": 0,
  "encoding_format": "float",
  "input": "string",
  "model": "qwen3-embedding-0.6b",
  "user": "string"
}
```

## Code samples

### cURL

```curl
curl --request POST \
  --url https://inference-api.ezghcloud.com/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/openai/v1/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "dimensions": 0,
  "encoding_format": "float",
  "input": "string",
  "model": "qwen3-embedding-0.6b",
  "user": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://inference-api.ezghcloud.com/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/openai/v1/embeddings';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    dimensions: 0,
    encoding_format: 'float',
    input: 'string',
    model: 'qwen3-embedding-0.6b',
    user: 'string'
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://inference-api.ezghcloud.com/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/openai/v1/embeddings"

payload = {
    "dimensions": 0,
    "encoding_format": "float",
    "input": "string",
    "model": "qwen3-embedding-0.6b",
    "user": "string"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

One embedding per input, in input order.

#### Example

```json
{
  "data": [
    {
      "embedding": [
        0
      ],
      "index": 0,
      "object": "embedding"
    }
  ],
  "model": "qwen3-embedding-0.6b:1.0.0",
  "object": "list",
  "usage": {
    "prompt_tokens": 0,
    "total_tokens": 0
  }
}
```

- `CreateEmbeddings.response.200.data` (array<object>, required)
  - `CreateEmbeddings.response.200.data.embedding` (one of, required) — An array of floats, or with encoding_format base64, the little-endian float32 values in base64.
    - one of: `array<number>`, `string`
  - `CreateEmbeddings.response.200.data.index` (integer, required)
    - min 0
  - `CreateEmbeddings.response.200.data.object` (string, required)
- `CreateEmbeddings.response.200.model` (string, required) — The resolved <id>:<version>.
- `CreateEmbeddings.response.200.object` (string, required)
- `CreateEmbeddings.response.200.usage` (object, required)
  - `CreateEmbeddings.response.200.usage.prompt_tokens` (integer, required)
    - min 0
  - `CreateEmbeddings.response.200.usage.total_tokens` (integer, required)
    - min 0

### 400

invalid_request_error (invalid_request, or the product's own code): the request isn't valid; param names the field.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "param": "string",
    "type": "string"
  }
}
```

- `CreateEmbeddings.response.400.error` (object, required)
  - `CreateEmbeddings.response.400.error.code` (string, required) — The platform's error code, as in every other EZGH Cloud API.
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `CreateEmbeddings.response.400.error.message` (string, required) — What went wrong, for people. A validation failure's problems are appended to it.
  - `CreateEmbeddings.response.400.error.param` (string | null, required) — The request field at fault (input, input[3], dimensions), or null.
  - `CreateEmbeddings.response.400.error.type` (string, required) — invalid_request_error, authentication_error, permission_error, not_found_error, rate_limit_error, insufficient_quota or api_error. Treat it as an open string.

### 401

authentication_error (unauthenticated): no bearer credential, or one that doesn't check out. The session cookie isn't read.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "param": "string",
    "type": "string"
  }
}
```

- `CreateEmbeddings.response.401.error` (object, required)
  - `CreateEmbeddings.response.401.error.code` (string, required) — The platform's error code, as in every other EZGH Cloud API.
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `CreateEmbeddings.response.401.error.message` (string, required) — What went wrong, for people. A validation failure's problems are appended to it.
  - `CreateEmbeddings.response.401.error.param` (string | null, required) — The request field at fault (input, input[3], dimensions), or null.
  - `CreateEmbeddings.response.401.error.type` (string, required) — invalid_request_error, authentication_error, permission_error, not_found_error, rate_limit_error, insufficient_quota or api_error. Treat it as an open string.

### 403

permission_error (access_denied): the caller's policies don't allow the action.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "param": "string",
    "type": "string"
  }
}
```

- `CreateEmbeddings.response.403.error` (object, required)
  - `CreateEmbeddings.response.403.error.code` (string, required) — The platform's error code, as in every other EZGH Cloud API.
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `CreateEmbeddings.response.403.error.message` (string, required) — What went wrong, for people. A validation failure's problems are appended to it.
  - `CreateEmbeddings.response.403.error.param` (string | null, required) — The request field at fault (input, input[3], dimensions), or null.
  - `CreateEmbeddings.response.403.error.type` (string, required) — invalid_request_error, authentication_error, permission_error, not_found_error, rate_limit_error, insufficient_quota or api_error. Treat it as an open string.

### 404

not_found_error (not_found, or the product's own code): unknown, malformed, or in an organization the caller isn't in.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "param": "string",
    "type": "string"
  }
}
```

- `CreateEmbeddings.response.404.error` (object, required)
  - `CreateEmbeddings.response.404.error.code` (string, required) — The platform's error code, as in every other EZGH Cloud API.
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `CreateEmbeddings.response.404.error.message` (string, required) — What went wrong, for people. A validation failure's problems are appended to it.
  - `CreateEmbeddings.response.404.error.param` (string | null, required) — The request field at fault (input, input[3], dimensions), or null.
  - `CreateEmbeddings.response.404.error.type` (string, required) — invalid_request_error, authentication_error, permission_error, not_found_error, rate_limit_error, insufficient_quota or api_error. Treat it as an open string.

### 409

The organization is being deleted (organization_deletion_pending). Nothing was computed or metered.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "param": "string",
    "type": "string"
  }
}
```

- `CreateEmbeddings.response.409.error` (object, required)
  - `CreateEmbeddings.response.409.error.code` (string, required) — The platform's error code, as in every other EZGH Cloud API.
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `CreateEmbeddings.response.409.error.message` (string, required) — What went wrong, for people. A validation failure's problems are appended to it.
  - `CreateEmbeddings.response.409.error.param` (string | null, required) — The request field at fault (input, input[3], dimensions), or null.
  - `CreateEmbeddings.response.409.error.type` (string, required) — invalid_request_error, authentication_error, permission_error, not_found_error, rate_limit_error, insufficient_quota or api_error. Treat it as an open string.

### 410

The pinned model version is retired (model_retired, param model).

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "param": "string",
    "type": "string"
  }
}
```

- `CreateEmbeddings.response.410.error` (object, required)
  - `CreateEmbeddings.response.410.error.code` (string, required) — The platform's error code, as in every other EZGH Cloud API.
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `CreateEmbeddings.response.410.error.message` (string, required) — What went wrong, for people. A validation failure's problems are appended to it.
  - `CreateEmbeddings.response.410.error.param` (string | null, required) — The request field at fault (input, input[3], dimensions), or null.
  - `CreateEmbeddings.response.410.error.type` (string, required) — invalid_request_error, authentication_error, permission_error, not_found_error, rate_limit_error, insufficient_quota or api_error. Treat it as an open string.

### 413

invalid_request_error (payload_too_large): the body is over the endpoint's limit.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "param": "string",
    "type": "string"
  }
}
```

- `CreateEmbeddings.response.413.error` (object, required)
  - `CreateEmbeddings.response.413.error.code` (string, required) — The platform's error code, as in every other EZGH Cloud API.
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `CreateEmbeddings.response.413.error.message` (string, required) — What went wrong, for people. A validation failure's problems are appended to it.
  - `CreateEmbeddings.response.413.error.param` (string | null, required) — The request field at fault (input, input[3], dimensions), or null.
  - `CreateEmbeddings.response.413.error.type` (string, required) — invalid_request_error, authentication_error, permission_error, not_found_error, rate_limit_error, insufficient_quota or api_error. Treat it as an open string.

### 429

rate_limit_error (too_many_requests), with Retry-After; or insufficient_quota (insufficient_quota), a monthly limit, without one and with x-should-retry: false.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "param": "string",
    "type": "string"
  }
}
```

- `CreateEmbeddings.response.429.error` (object, required)
  - `CreateEmbeddings.response.429.error.code` (string, required) — The platform's error code, as in every other EZGH Cloud API.
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `CreateEmbeddings.response.429.error.message` (string, required) — What went wrong, for people. A validation failure's problems are appended to it.
  - `CreateEmbeddings.response.429.error.param` (string | null, required) — The request field at fault (input, input[3], dimensions), or null.
  - `CreateEmbeddings.response.429.error.type` (string, required) — invalid_request_error, authentication_error, permission_error, not_found_error, rate_limit_error, insufficient_quota or api_error. Treat it as an open string.

### 500

api_error (internal_error): a bug; the details are in the logs, under the request ID.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "param": "string",
    "type": "string"
  }
}
```

- `CreateEmbeddings.response.500.error` (object, required)
  - `CreateEmbeddings.response.500.error.code` (string, required) — The platform's error code, as in every other EZGH Cloud API.
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `CreateEmbeddings.response.500.error.message` (string, required) — What went wrong, for people. A validation failure's problems are appended to it.
  - `CreateEmbeddings.response.500.error.param` (string | null, required) — The request field at fault (input, input[3], dimensions), or null.
  - `CreateEmbeddings.response.500.error.type` (string, required) — invalid_request_error, authentication_error, permission_error, not_found_error, rate_limit_error, insufficient_quota or api_error. Treat it as an open string.

### 502

The model backend failed or returned an incomplete result (inference_failed). Nothing was metered.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "param": "string",
    "type": "string"
  }
}
```

- `CreateEmbeddings.response.502.error` (object, required)
  - `CreateEmbeddings.response.502.error.code` (string, required) — The platform's error code, as in every other EZGH Cloud API.
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `CreateEmbeddings.response.502.error.message` (string, required) — What went wrong, for people. A validation failure's problems are appended to it.
  - `CreateEmbeddings.response.502.error.param` (string | null, required) — The request field at fault (input, input[3], dimensions), or null.
  - `CreateEmbeddings.response.502.error.type` (string, required) — invalid_request_error, authentication_error, permission_error, not_found_error, rate_limit_error, insufficient_quota or api_error. Treat it as an open string.

### 503

api_error (unavailable): a dependency the request needs is down. Retry after Retry-After.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "param": "string",
    "type": "string"
  }
}
```

- `CreateEmbeddings.response.503.error` (object, required)
  - `CreateEmbeddings.response.503.error.code` (string, required) — The platform's error code, as in every other EZGH Cloud API.
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `CreateEmbeddings.response.503.error.message` (string, required) — What went wrong, for people. A validation failure's problems are appended to it.
  - `CreateEmbeddings.response.503.error.param` (string | null, required) — The request field at fault (input, input[3], dimensions), or null.
  - `CreateEmbeddings.response.503.error.type` (string, required) — invalid_request_error, authentication_error, permission_error, not_found_error, rate_limit_error, insufficient_quota or api_error. Treat it as an open string.

### 504

The model didn't answer within the 60 s deadline (inference_timeout). Nothing was metered.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "param": "string",
    "type": "string"
  }
}
```

- `CreateEmbeddings.response.504.error` (object, required)
  - `CreateEmbeddings.response.504.error.code` (string, required) — The platform's error code, as in every other EZGH Cloud API.
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `CreateEmbeddings.response.504.error.message` (string, required) — What went wrong, for people. A validation failure's problems are appended to it.
  - `CreateEmbeddings.response.504.error.param` (string | null, required) — The request field at fault (input, input[3], dimensions), or null.
  - `CreateEmbeddings.response.504.error.type` (string, required) — invalid_request_error, authentication_error, permission_error, not_found_error, rate_limit_error, insufficient_quota or api_error. Treat it as an open string.


Source: https://docs.ezghcloud.com/inference-api/CreateEmbeddings/index.md
