POST /ai/embeddings
Compute embeddings
Scope ai:inference. Available on request: served only when Galon AI is open to the account (404 otherwise). No provider name is returned. Exposed only if an embeddings model is served. Idempotency-Key required.
API key (Bearer), on the public API endpoint.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string · required |
Request body
application/json
| Field | Type | Description |
|---|---|---|
model | string · required | |
input | any · required | |
encoding_format | "float" | "base64" |
Responses
| Status | Description | Body |
|---|---|---|
200 | Vectors | object |
402 | Insufficient balance | Error |
503 | model_temporarily_unavailable | Error |
401 | Key missing or invalid | Error |
Examples
curl
curl -X POST "$GALON_API_BASE/ai/embeddings" \
-H "Authorization: Bearer $GALON_API_KEY" \
-H "Idempotency-Key: <unique-key>" \
-H "Content-Type: application/json" \
-d '{"model": "string", "input": null}'Node.js (SDK)
import { Galon } from "galon";
const galon = new Galon(process.env.GALON_API_KEY);
const result = await galon.ai.embeddings({"model": "string", "input": null}, { idempotencyKey: "<unique-key>" });Python (SDK)
from galon import Galon
galon = Galon() # reads GALON_API_KEY
result = galon.ai.embeddings({"model": "string", "input": None}, idempotency_key="<unique-key>")