Hi! โ
This is the Zaia's API documentation!
Things are a little... out of the oven right now. But hang tight! We'll add a lot of cool things as soon as our Product Owner lets us.
By the wayโฆ commenting is enabled and you're welcome to leave your suggestions, issues or comments here!
Before attempting to call any APIs, you need a key. Ensure you have your API key readily available following the steps described in the Creating an API Key page.
Nothing fancy here. Just pass the API Key in the request headers like in the examples below.
curl --location '<https://api.zaia.app/><endpoint path>' \\
--header 'Authorization: Bearer <your api key here>'
To call any API, you need an API Key for the desired agent. To get yours, go through the following steps:
Access platform.zaia.app.
Select the agent that you want to call through the API.
Select the tab Onde Usar.
Click the API Key card.
Click in Gerar on the right end side.
Copy your key.
Now that you have your API Key, you can go back to Authorization and check how to use it.
Our endpoints are grouped according to the main entity/action
.
For example: /v1/api/agent/retrieve
, agent being the entity
and retrieve
being the action.
Following this rule you'll be able to find anything around here.
Another important thing to mention, the base URL isAnother important thing to mention, the base URL is https://api.zaia.app
.
<aside> โ ๏ธ
Be sure to prefix the endpoints with it.
</aside>
This is the entity responsible for managing all chats that were created outside of the Zaia's Platform.
Retrieve an external generative chat.
Request
curl --location '<https://api.zaia.app/v1/api/external-generative-chat/retrieve?id=123>' \\
--header 'Accept: application/json' \\
--header 'Authorization: Bearer <your api key here>'
Responses
Creates a new chat for future message exchanges.
curl --location --request POST '<https://api.zaia.app/v1/api/external-generative-chat/create>' \\
--header 'Authorization: Bearer <your api key goes here>'
Responses
This is the entity responsible for managing all messages that were created outside of the Zaia's Platform.
Generate a new message.
curl --location --request POST '<https://api.zaia.app/v1/api/external-generative-message/create>' \\
--header 'Content-Type: application/json' \\
--header 'Accept: application/json' \\
--header 'Authorization: Bearer <your api key goes here>' \\
--data '{
"externalGenerativeChatId": 123,
"prompt": "Hi! I need help...",
"streaming": false
}'
Responses
This is the entity responsible for managing the Zaia Platform Agent.
Creates a new agent.
curl --location --request POST '<https://api.zaia.app/v1/api/agent/create>' \\
--header 'Content-Type: application/json' \\
--header 'Accept: application/json' \\
--header 'Authorization: Bearer <your api key goes here>' \\
--data '{
"name": 123,
"template": "generic",
"pictureURL": "*data:image/png;base64,iVBORw0KGโฆ*"
}'
Responses
Update an agent.
curl --location --request PATCH '<https://api.zaia.app/v1/api/agent/update>' \\
--header 'Content-Type: application/json' \\
--header 'Accept: application/json' \\
--header 'Authorization: Bearer <your api key goes here>' \\
--data '{
"agentId": 123,
"behavior": "You are an artificial intelligence assistant...",
"initialChatMessage": "Hi, Im your new assistant...",
"name": "Agent Zaia",
"pictureURL": "*data:image/png;base64,iVBORw0KGโฆ*"
}'
Responses
Remove an agent.
curl --location --request DELETE '<https://api.zaia.app/v1/api/agent/remove/?agentId=123>' \\
--header 'Content-Type: application/json' \\
--header 'Accept: application/json' \\
--header 'Authorization: Bearer <your api key goes here>'
Responses