Palbase ai · API
/ai/embeddingsTurn texts into vectors
One vector per text, in the order of the input. Up to 1,024 texts per request — a longer list is several requests, and the SDK cuts it; the platform splits a request over the provider's own limits.
Called by your server, with the project's secret key.
Request body
dimensionsinteger · optionalA shorter vector than the model's own (0 or absent: the model's).inputstring[] · requiredThe texts (1,024 at most, none empty).modelstring · optionalAn embedding model's name (GET /ai/models), or left out for the default.curl -X POST "https://<your-ref>.palbase.studio/ai/embeddings" \
-H "apikey: $PALBASE_SECRET_KEY" \
-H "content-type: application/json" \
-d '{"input":["string"]}'Responses
200The vectors
400The request is malformed, or names what this module does not offer (the error names which)
401No valid credential
402Palbase's models do not serve the project now and it has not connected its own key for this model's provider (PUT /ai/providers/{provider}): its monthly AI budget is spent (ai_budget_reached), its month's free dollar is spent and it has no paid rights to pay past it (ai_payment_required), or they do not serve it (provider_key_required). GET /ai/spend says which.
403A publishable key or a user's session: everything here is the project's server's, called with the secret key
413The body is larger than the route takes
429The project's request rate, or the provider's for its connection, is used up — or the project holds as much as it may at once: 32 open streams at one of the module's servers (too_many_streams), 2 pictures being made (too_many_images), 512 MiB of pictures kept here for their day (image_storage_full), or the service — or the project's share of it — holds as much of its requests at once as it takes: their bodies, an embedding request's vectors, the pictures being made (busy). Retry-After says when to try again
503The model service or the database did not answer; retry shortly
defaultAn error: the envelope names it (`error`) and explains it (`error_description`).
Operation CreateEmbeddings of ai's contract.