Skip to main content
POST
/
embeddings
Create embeddings
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    model: '<string>',
    input: '<string>',
    encoding_format: 'float',
    dimensions: 2,
    provider_options: {
      google: {task_type: '<string>', title: '<string>'},
      mistral: {output_dtype: 'float'}
    },
    user: '<string>',
    debug: {
      enabled: true,
      return_upstream_request: true,
      return_upstream_response: true,
      trace: true,
      trace_level: 'summary'
    },
    provider: {
      order: ['<string>'],
      only: ['<string>'],
      ignore: ['<string>'],
      include_alpha: true
    }
  })
};

fetch('https://api.phaseo.app/v1/embeddings', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "object": "<string>",
  "data": [
    {
      "object": "<string>",
      "embedding": [
        123
      ],
      "index": 123
    }
  ],
  "model": "<string>",
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123,
    "server_tool_use": {
      "datetime_requests": 1
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

application/json
model
string
required
input
required
encoding_format
enum<string>
Available options:
float,
base64
dimensions
integer
Required range: x >= 1
provider_options
object
user
string
debug
object

Gateway debug controls. These flags are never forwarded upstream.

provider
object

Provider routing preferences for gateway selection.

Response

200 - application/json

Embeddings response

object
string
data
object[]
model
string
usage
object
Last modified on March 16, 2026