Skip to content
v0.18.0stable

Embeddings

POST /v1/embeddings  compatible  semantic operation embed  contract revision 1

State semantics: stateless; an Idempotency-Key adds a 24 hour record of the key, its request fingerprint and how far the request got, and no part of the request or the answer

Raw contract deviations

These statements are source-contract evidence. Use the examples, field table, and Profile coverage matrix for ordinary integration, and expand this list when investigating a compatibility boundary.

  • gateway routes model names
  • unknown request fields are rejected before provider I/O
  • provider-specific unsupported fields are rejected before provider I/O
  • Idempotency-Key is optional and buys at-most-once execution upstream, not response replay: a repeat of a key whose request finished answers 409 idempotency_completed rather than the original answer, because the answer is not stored
  • a repeat while the first request is still running answers 409 idempotency_in_progress; it is a refusal rather than a wait, because holding a socket against another request’s outcome is not something this gateway does
  • a repeat after a request that may have reached the provider and whose outcome nobody can determine — an ambiguous upstream failure, or a dispatch interrupted by a restart — answers 409 idempotency_outcome_unknown, which retrying the same key will not change; whether to give up or retry under a new key is the caller’s decision
  • the same key with a different request body answers 409 idempotency_conflict, and keys are scoped to one Project so two Projects may use the same external key
  • a request with no Idempotency-Key behaves exactly as before and writes nothing durable; the key is what buys the record
  • a request the gateway refuses on its own — a capability filter, a token limit, a Project budget — never reached the upstream and gives its key back, so a retry is answered by the limit it broke rather than by a conflict about a call nobody made
  • a key is remembered for 24 hours, whatever state its request ended in, after which the same key is free again — including for a different request
Terminal window
curl https://halro.example.com/v1/embeddings \
-H "Authorization: Bearer $HALRO_GATEWAY_KEY" \
-H "Content-Type: application/json" \
-d '{ "model": "embed", "input": ["first passage", "second passage"] }'
  • Authorization
  • Content-Type
  • Idempotency-Key
Request fields
FieldProvider Profiles that do not support itCombination-level constraints
model——
inputbedrock.runtime.invoke.titan-embed-text-v2.v1—
encoding_formatbigmodel.cn.chat-embeddings.v1, gemini.generate-content.text.v1beta, bedrock.runtime.invoke.titan-embed-text-v2.v11
dimensionsbedrock.runtime.invoke.titan-embed-text-v2.v1—
userbigmodel.cn.chat-embeddings.v1, gemini.generate-content.text.v1beta, bedrock.runtime.invoke.titan-embed-text-v2.v12

object data model usage

Provider Profile contract coverage and current availability

Section titled “Provider Profile contract coverage and current availability”
Provider Profile contract coverage and current availability
Provider ProfileMaturityCurrent buildUnsupported request fields
openai.chat-embeddings.v1compatiblecreatableundeclared
azure-openai.chat-embeddings.v1compatiblecreatableundeclared
bigmodel.cn.chat-embeddings.v1experimentalcreatableencoding_format, user
openai-compatible.chat-embeddings.v1compatiblecreatableundeclared
gemini.generate-content.text.v1betacompatiblecreatableencoding_format, user
bedrock.runtime.invoke.titan-embed-text-v2.v1experimentalwithheld (cannot create)input, encoding_format, dimensions, user
bigmodel.cn.chat-embeddings.v1
  • the OpenAI-shaped embedding body is sent to the mainland /api/paas/v4/embeddings route
  • encoding_format and user are omitted only when absent and otherwise rejected before provider I/O
gemini.generate-content.text.v1beta
  • token usage is locally estimated when Gemini omits usage
bedrock.runtime.invoke.titan-embed-text-v2.v1
  • only one string input is accepted
  • dimensions are limited to 256, 512, or 1024
  • native requests force normalized float embeddings
  • Bedrock inputTextTokenCount is mapped to OpenAI usage

Verified evidence: gateway_contract, provider_transport_fixture, sdk_blackbox

openai-go, openai-node, openai-python

See Embedding index and Rerank planning.


Fields, coverage, transformations, and deviations are generated from Halro 9649ecb8e200 (scripts/generate-api-pages-en.mjs; synchronized manifest digest 5d90dc530c8428bd…).

The contract currently carries field names, not complete types, required relationships, or value semantics.

  1. Combination constraints for encoding_format:

    • bigmodel.cn.chat-embeddings.v1: encoding_format and user are omitted only when absent and otherwise rejected before provider I/O
    ↩
  2. Combination constraints for user:

    • bigmodel.cn.chat-embeddings.v1: encoding_format and user are omitted only when absent and otherwise rejected before provider I/O
    ↩