Skip to content

Create embeddings (OpenAI-compatible)

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.

POST
https://inference-api.ezghcloud.com/v1/organizations/{orgId}/projects/{projectId}/openai/v1/embeddings

Authorization

  • apiKeyoptionalHTTP
  • oauthoptionalHTTP

Path parameters

  • orgIdstringrequired
    format: uuid
  • projectIdstringrequired
    format: uuid

Request bodyJSONrequired

  • inputstringorarray<string>required

    The text to embed: a string, or an array of 1 to the model's maxInputs strings. Empty strings are refused.

    2 variants

    One of the following:

    • string
    • array<string>
  • modelstringrequired

    A catalog model ID, or :.

  • dimensionsoptionalinteger

    The vectors' length, from the model's minDimensions to its dimensions.

  • encoding_formatoptionalfloatorbase64
    Default: "float"
  • useroptionalstring

    Accepted and ignored; never stored or forwarded.

Returns

200

One embedding per input, in input order.

JSON
  • dataarray ofobjectrequired
    3 properties
    • embeddingarray<number>orstringrequired

      An array of floats, or with encoding_format base64, the little-endian float32 values in base64.

      2 variants

      One of the following:

      • array<number>
      • string
    • indexintegerrequired
      minimum: 0
    • objectstringrequired
  • modelstringrequired

    The resolved :.

  • objectstringrequired
  • usageobjectrequired
    2 properties
    • prompt_tokensintegerrequired
      minimum: 0
    • total_tokensintegerrequired
      minimum: 0

400

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

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired

      The platform's error code, as in every other EZGH Cloud API.

      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired

      What went wrong, for people. A validation failure's problems are appended to it.

    • paramstring | nullrequired

      The request field at fault (input, input[3], dimensions), or null.

    • typestringrequired

      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.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired

      The platform's error code, as in every other EZGH Cloud API.

      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired

      What went wrong, for people. A validation failure's problems are appended to it.

    • paramstring | nullrequired

      The request field at fault (input, input[3], dimensions), or null.

    • typestringrequired

      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.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired

      The platform's error code, as in every other EZGH Cloud API.

      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired

      What went wrong, for people. A validation failure's problems are appended to it.

    • paramstring | nullrequired

      The request field at fault (input, input[3], dimensions), or null.

    • typestringrequired

      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.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired

      The platform's error code, as in every other EZGH Cloud API.

      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired

      What went wrong, for people. A validation failure's problems are appended to it.

    • paramstring | nullrequired

      The request field at fault (input, input[3], dimensions), or null.

    • typestringrequired

      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.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired

      The platform's error code, as in every other EZGH Cloud API.

      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired

      What went wrong, for people. A validation failure's problems are appended to it.

    • paramstring | nullrequired

      The request field at fault (input, input[3], dimensions), or null.

    • typestringrequired

      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).

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired

      The platform's error code, as in every other EZGH Cloud API.

      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired

      What went wrong, for people. A validation failure's problems are appended to it.

    • paramstring | nullrequired

      The request field at fault (input, input[3], dimensions), or null.

    • typestringrequired

      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.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired

      The platform's error code, as in every other EZGH Cloud API.

      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired

      What went wrong, for people. A validation failure's problems are appended to it.

    • paramstring | nullrequired

      The request field at fault (input, input[3], dimensions), or null.

    • typestringrequired

      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.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired

      The platform's error code, as in every other EZGH Cloud API.

      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired

      What went wrong, for people. A validation failure's problems are appended to it.

    • paramstring | nullrequired

      The request field at fault (input, input[3], dimensions), or null.

    • typestringrequired

      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.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired

      The platform's error code, as in every other EZGH Cloud API.

      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired

      What went wrong, for people. A validation failure's problems are appended to it.

    • paramstring | nullrequired

      The request field at fault (input, input[3], dimensions), or null.

    • typestringrequired

      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.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired

      The platform's error code, as in every other EZGH Cloud API.

      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired

      What went wrong, for people. A validation failure's problems are appended to it.

    • paramstring | nullrequired

      The request field at fault (input, input[3], dimensions), or null.

    • typestringrequired

      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.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired

      The platform's error code, as in every other EZGH Cloud API.

      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired

      What went wrong, for people. A validation failure's problems are appended to it.

    • paramstring | nullrequired

      The request field at fault (input, input[3], dimensions), or null.

    • typestringrequired

      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.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired

      The platform's error code, as in every other EZGH Cloud API.

      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired

      What went wrong, for people. A validation failure's problems are appended to it.

    • paramstring | nullrequired

      The request field at fault (input, input[3], dimensions), or null.

    • typestringrequired

      invalid_request_error, authentication_error, permission_error, not_found_error, rate_limit_error, insufficient_quota or api_error. Treat it as an open string.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close