Palbase ai · API
/ai/agent-draftsWrite an agent from a description
A definition written from a description: instructions, a model, the project's own tools that fit (named by their name: the agent follows the code), subagents and an output shape where the description calls for them. Nothing is kept: put it (PUT /ai/agents/{name}) to have it. It is a person's (a developer's session or token: 403 person_required for the secret key), the platform pays for it, and it is bounded (429 too_many_drafts): 20 an hour by a person in a project, 60 by its people, 40 by a person across their projects — and the platform's day (429 drafts_paused).
Called by your server, with the project's secret key.
Request body
descriptionstring · requiredThe agent, in words.namestring · optionalThe name it is to have (left out: one is suggested).curl -X POST "https://<your-ref>.palbase.studio/ai/agent-drafts" \
-H "apikey: $PALBASE_SECRET_KEY" \
-H "content-type: application/json" \
-d '{"description":"string"}'Responses
200The agent written
400The request is malformed, or names what this module does not offer (the error names which)
401No valid credential
403A publishable key or a user's session: everything here is the project's server's, called with the secret key
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 DraftAgent of ai's contract.