Fleek AI Agent APIs#

Deploying AI agents on Fleek has never been a hassle and you can now deploy from within your applications and projects as well. By exposing these APIs, Fleek enables users to seamlessly integrate AI agent management capabilities into their applications.

Prerequisites and setup#

To follow the guide below, you need to ensure that you have a Fleek account. You can sign up for one if you don’t already have one at app.fleek.xyz.

API Base Endpoint: https://api.fleek.xyz/api

Creating API Keys#

Create an API key from the Eliza deployment page#

To create an API key:

  1. On the fleek.xyz/eliza page. Click on the “Account settings” button at the bottom of the page.
  2. The “API tokens” tab shows up with all the API keys you have created.

Eliza page tokens

  1. To create an API key from the Eliza deployment page, click on the “Create API token” button and a modal appears.
  2. Type in the name of the API key you want to create and click on the “Create API token” button.

Create API token

Create an API key from the Fleek dashboard#

To create an API key:

  1. Navigate to your Fleek project’s dashboard.
  2. In the sidebar, click on your profile icon to reveal the menu.
  3. Select the menu option “Account settings”.

Account settings

  1. In the account settings page, click on the “API Keys” tab.
  2. On this panel, you will find a list of managed API keys.

API keys

To create an API key, type your desired key name in the input field and click on the “Add API token” button.

Using the Fleek agent APIs#

You can find the API documentation here. With these APIs, you can:

  • Fetch an agent’s details
  • Create agents
  • Get an agent’s status (active or inactive)
  • View your created agents
  • Delete agents
  • Update agents
  • Get agent logs
  • Start an agent
  • Stop an agent

AI agent proxy on Fleek#

Fleek provides an endpoint that proxies requests to an AI agent’s API on Fleek, supporting GET, POST, PUT, DELETE, etc.

URL structure:


https://api.fleek.xyz/api/v1/ai-agents/{agentId}/api/{*key}

Headers:

  • X-Api-Key – Required for authentication.

Path Parameters:

  • agentId – AI agent’s ID.
  • key – API path on the agent’s server.

Example Request

fetch('https://api.fleek.xyz/api/v1/ai-agents/12345/api/message', {
  method: 'POST',

  headers: {
    'X-Api-Key': 'your-api-key',
    'Content-Type': 'application/json',
  },

  body: JSON.stringify({ text: 'Hello, AI!' }),
});

For more details, check the full API docs .

Agent API endpoints#

/api/v1/ai-agents

getList all AI agents
This endpoint is used to list all AI agents for a given user. The response is paginated. You can use the `cursor` you get back in the response to paginate through the results.

Parameters:

  • size* (query) - Size of the page
    Example: 10
  • cursor (query) - Cursor to paginate through the results
  • name (query) - Name filter for the AI agents
  • projectId (query) - Project id filter for the AI agents

Responses:

Status: 200
Page of AI agents
application/json
View Example
Example
{ "data": [ { "avatar": "dGVzdGltYWdlZGF0YQ==", "characterFile": "{\"name\":\"TestforFleekDraft\",\"plugins\":[],\"clients\":[\"telegram\"],\"modelProvider\":\"openai\",\"settings\":{\"secrets\":{\"OPENAI_API_KEY\":\"sk-xxxx\",\"TELEGRAM_BOT_TOKEN\":\"xxxx\"},\"voice\":{\"model\":\"en_US-male-medium\"}},\"bio\":[\"TestforFleek\"],\"lore\":[\"TestforFleek\"],\"knowledge\":[\"TestforFleek\"],\"messageExamples\":[[{\"user\":\"{{user1}}\",\"content\":{\"text\":\"TestforFleek\"}},{\"user\":\"Character\",\"content\":{\"text\":\"TestforFleek\"}}]],\"postExamples\":[\"TestforFleek\"],\"style\":{\"all\":[\"TestforFleek\"],\"chat\":[\"TestforFleek\"],\"post\":[\"TestforFleek\"]},\"topics\":[\"testforfleek\"],\"adjectives\":[\"testforfleek\"]}", "createdAt": "2021-01-01T00:00:00Z", "createdBy": "your_user_id", "frameworkName": "eliza", "frameworkVersion": "1.0.0", "id": "your_agent_id", "name": "Your Agent's Name", "projectId": "your_project_id", "status": "Created", "updatedAt": "2021-01-01T00:00:00Z" } ], "next": "next_cursor", "prev": "prev_cursor" }

/api/v1/ai-agents/{agentId}

getGet an AI agent
This endpoint is used to get an AI agent by its id. The response is the AI agent.

Parameters:

  • agentId* (path) - AI agent's id

Responses:

Status: 201
AI agent
application/json
View Example
Example
{ "avatar": "dGVzdGltYWdlZGF0YQ==", "characterFile": "{\"name\":\"TestforFleekDraft\",\"plugins\":[],\"clients\":[\"telegram\"],\"modelProvider\":\"openai\",\"settings\":{\"secrets\":{\"OPENAI_API_KEY\":\"sk-xxxx\",\"TELEGRAM_BOT_TOKEN\":\"xxxx\"},\"voice\":{\"model\":\"en_US-male-medium\"}},\"bio\":[\"TestforFleek\"],\"lore\":[\"TestforFleek\"],\"knowledge\":[\"TestforFleek\"],\"messageExamples\":[[{\"user\":\"{{user1}}\",\"content\":{\"text\":\"TestforFleek\"}},{\"user\":\"Character\",\"content\":{\"text\":\"TestforFleek\"}}]],\"postExamples\":[\"TestforFleek\"],\"style\":{\"all\":[\"TestforFleek\"],\"chat\":[\"TestforFleek\"],\"post\":[\"TestforFleek\"]},\"topics\":[\"testforfleek\"],\"adjectives\":[\"testforfleek\"]}", "createdAt": "2021-01-01T00:00:00Z", "createdBy": "your_user_id", "frameworkName": "eliza", "frameworkVersion": "1.0.0", "id": "your_agent_id", "name": "Your Agent's Name", "projectId": "your_project_id", "status": "Draft", "updatedAt": "2021-01-01T00:00:00Z" }
Status: 404
AI agent not found
application/json
putUpdate an AI agent
This endpoint is used to update an AI agent. The response is the updated AI agent. All fields are optional. You can update one or more fields.

Parameters:

  • agentId* (path) - AI agent's id

Request Body:

Required.
application/json
Examples:
Example w/ all fields{ "avatar": "dGVzdGltYWdlZGF0YQ==", "characterFile": "{\"name\":\"TestforFleekDraft\",\"plugins\":[],\"clients\":[\"telegram\"],\"modelProvider\":\"openai\",\"settings\":{\"secrets\":{\"OPENAI_API_KEY\":\"sk-xxxx\",\"TELEGRAM_BOT_TOKEN\":\"xxxx\"},\"voice\":{\"model\":\"en_US-male-medium\"}},\"bio\":[\"TestforFleek\"],\"lore\":[\"TestforFleek\"],\"knowledge\":[\"TestforFleek\"],\"messageExamples\":[[{\"user\":\"{{user1}}\",\"content\":{\"text\":\"TestforFleek\"}},{\"user\":\"Character\",\"content\":{\"text\":\"TestforFleek\"}}]],\"postExamples\":[\"TestforFleek\"],\"style\":{\"all\":[\"TestforFleek\"],\"chat\":[\"TestforFleek\"],\"post\":[\"TestforFleek\"]},\"topics\":[\"testforfleek\"],\"adjectives\":[\"testforfleek\"]}", "name": "My new AI Agent" }
Example w/ avatar{ "avatar": "dGVzdGltYWdlZGF0YQ==" }
Example w/ character file{ "characterFile": "{\"name\":\"TestforFleekDraft\",\"plugins\":[],\"clients\":[\"telegram\"],\"modelProvider\":\"openai\",\"settings\":{\"secrets\":{\"OPENAI_API_KEY\":\"sk-xxxx\",\"TELEGRAM_BOT_TOKEN\":\"xxxx\"},\"voice\":{\"model\":\"en_US-male-medium\"}},\"bio\":[\"TestforFleek\"],\"lore\":[\"TestforFleek\"],\"knowledge\":[\"TestforFleek\"],\"messageExamples\":[[{\"user\":\"{{user1}}\",\"content\":{\"text\":\"TestforFleek\"}},{\"user\":\"Character\",\"content\":{\"text\":\"TestforFleek\"}}]],\"postExamples\":[\"TestforFleek\"],\"style\":{\"all\":[\"TestforFleek\"],\"chat\":[\"TestforFleek\"],\"post\":[\"TestforFleek\"]},\"topics\":[\"testforfleek\"],\"adjectives\":[\"testforfleek\"]}" }
Example w/ name{ "name": "My new AI Agent" }

Responses:

Status: 200
Updated AI agent
application/json
View Example
Example
{ "avatar": "dGVzdGltYWdlZGF0YQ==", "characterFile": "{\"name\":\"TestforFleekDraft\",\"plugins\":[],\"clients\":[\"telegram\"],\"modelProvider\":\"openai\",\"settings\":{\"secrets\":{\"OPENAI_API_KEY\":\"sk-xxxx\",\"TELEGRAM_BOT_TOKEN\":\"xxxx\"},\"voice\":{\"model\":\"en_US-male-medium\"}},\"bio\":[\"TestforFleek\"],\"lore\":[\"TestforFleek\"],\"knowledge\":[\"TestforFleek\"],\"messageExamples\":[[{\"user\":\"{{user1}}\",\"content\":{\"text\":\"TestforFleek\"}},{\"user\":\"Character\",\"content\":{\"text\":\"TestforFleek\"}}]],\"postExamples\":[\"TestforFleek\"],\"style\":{\"all\":[\"TestforFleek\"],\"chat\":[\"TestforFleek\"],\"post\":[\"TestforFleek\"]},\"topics\":[\"testforfleek\"],\"adjectives\":[\"testforfleek\"]}", "createdAt": "2021-01-01T00:00:00Z", "createdBy": "your_user_id", "frameworkName": "eliza", "frameworkVersion": "1.0.0", "id": "your_agent_id", "name": "Your Agent's Name", "projectId": "your_project_id", "status": "Draft", "updatedAt": "2021-01-01T00:00:00Z" }
Status: 404
AI agent not found
application/json
deleteDelete an AI agent
This endpoint is used to delete an AI agent. The response is the deleted AI agent.

Parameters:

  • agentId* (path) - AI agent's id

Responses:

Status: 200
Deleted AI agent
application/json
View Example
Example
{ "avatar": "dGVzdGltYWdlZGF0YQ==", "characterFile": "{\"name\":\"TestforFleekDraft\",\"plugins\":[],\"clients\":[\"telegram\"],\"modelProvider\":\"openai\",\"settings\":{\"secrets\":{\"OPENAI_API_KEY\":\"sk-xxxx\",\"TELEGRAM_BOT_TOKEN\":\"xxxx\"},\"voice\":{\"model\":\"en_US-male-medium\"}},\"bio\":[\"TestforFleek\"],\"lore\":[\"TestforFleek\"],\"knowledge\":[\"TestforFleek\"],\"messageExamples\":[[{\"user\":\"{{user1}}\",\"content\":{\"text\":\"TestforFleek\"}},{\"user\":\"Character\",\"content\":{\"text\":\"TestforFleek\"}}]],\"postExamples\":[\"TestforFleek\"],\"style\":{\"all\":[\"TestforFleek\"],\"chat\":[\"TestforFleek\"],\"post\":[\"TestforFleek\"]},\"topics\":[\"testforfleek\"],\"adjectives\":[\"testforfleek\"]}", "createdAt": "2021-01-01T00:00:00Z", "createdBy": "your_user_id", "frameworkName": "eliza", "framrworkVersion": "1.0.0", "id": "your_agent_id", "name": "Your Agent's Name", "projectId": "your_project_id", "status": "Draft", "updatedAt": "2021-01-01T00:00:00Z" }
Status: 404
AI agent not found
application/json

/api/v1/ai-agents/{agentId}/api/{*key}

getProxy requests to the AI agent's API
This endpoint is used to proxy requests to the AI agent API. Any method is supported (GET, POST, PUT, DELETE, etc.). It will forward the request to the AI agent API and return the response. Examples of Eliza server's API paths: - `/agents` - `/agents/{agentId}` - `/{agentId}/message` - `/{agentId}/whisper` - `/{agentId}/tts` You can find more information about the Eliza server's API in the [Eliza documentation](https://elizaos.github.io/eliza/docs/packages/clients/#api-endpoints).

Parameters:

  • agentId* (path) - AI agent's id
  • key* (path) - Eliza server's API path

Responses:

Status: 200
Proxy requests to the AI agent API

/api/v1/ai-agents/{agentId}/attestation

getGet the attestation bytes for an AI agent
This endpoint is used to get the attestation bytes for an AI agent. The attestation bytes are used to verify the image of the host your agent is running on, the eliza version, and the character file.

Parameters:

  • agentId* (path) - AI agent's id

Responses:

Status: 200
Get the attestation bytes for an AI agent
application/octet-stream
Status: 404
AI agent not found
application/json

/api/v1/ai-agents/{agentId}/logs

getGet the logs from an AI agent
This endpoint is used to get a paginated list of an AI agent's logs. The priority is an integer between 0 and 7, where 0 is the highest priority and 7 is the lowest: 0 - EMERG 1 - ALERT 2 - CRIT 3 - ERROR 4 - WARN 5 - NOTICE 6 - INFO 7 - DEBUG

Parameters:

  • size* (path) - The number of results per page
  • cursor* (path) - The cursor to paginate through the results, will be returned in the response
  • agentId* (path) -

Responses:

Status: 200
Get the logs for an AI agent
application/json
View Example
Example
{ "data": [ { "id": "log_id", "message": "Hello, world!", "priority": 1, "timestamp": "2021-01-01T00:00:00Z" } ], "next": "next_cursor", "prev": "prev_cursor" }
Status: 400
Bad Request
Status: 403
PermissionDenied
application/json

/api/v1/ai-agents/{agentId}/publish

postPublish a draft AI
This endpoint is used to publish an AI agent in draft status. The AI agent will be deployed and its status will be set to `Created`.

Parameters:

  • agentId* (path) - AI agent's id

Responses:

Status: 200
Create an AI agent
application/json
View Example
Example
{ "avatar": "dGVzdGltYWdlZGF0YQ==", "characterFile": "{\"name\":\"TestforFleekDraft\",\"plugins\":[],\"clients\":[\"telegram\"],\"modelProvider\":\"openai\",\"settings\":{\"secrets\":{\"OPENAI_API_KEY\":\"sk-xxxx\",\"TELEGRAM_BOT_TOKEN\":\"xxxx\"},\"voice\":{\"model\":\"en_US-male-medium\"}},\"bio\":[\"TestforFleek\"],\"lore\":[\"TestforFleek\"],\"knowledge\":[\"TestforFleek\"],\"messageExamples\":[[{\"user\":\"{{user1}}\",\"content\":{\"text\":\"TestforFleek\"}},{\"user\":\"Character\",\"content\":{\"text\":\"TestforFleek\"}}]],\"postExamples\":[\"TestforFleek\"],\"style\":{\"all\":[\"TestforFleek\"],\"chat\":[\"TestforFleek\"],\"post\":[\"TestforFleek\"]},\"topics\":[\"testforfleek\"],\"adjectives\":[\"testforfleek\"]}", "createdAt": "2021-01-01T00:00:00Z", "createdBy": "your_user_id", "frameworkName": "eliza", "framrworkVersion": "1.0.0", "id": "your_agent_id", "name": "Your Agent's Name", "projectId": "your_project_id", "status": "Created", "updatedAt": "2021-01-01T00:00:00Z" }
Status: 402
Payment required
application/json

/api/v1/ai-agents/{agentId}/start

postStart an AI agent
This endpoint is used to start an AI agent. Not related to the status found in the AI agent object. A 200 status code is returned if the agent is successfully started.

Parameters:

  • agentId* (path) - AI agent's id

Responses:

Status: 200
Start an AI agent

/api/v1/ai-agents/{agentId}/status

getGet the status of an AI agent
This endpoint is used to get the status of an AI agent. Not related to the status found in the AI agent object. The response is the status of the AI agent. `true` if the agent is running, `false` otherwise.

Parameters:

  • agentId* (path) -

Responses:

Status: 200
Get the status of an AI agent
application/json
View Example
Running agent
{ "status": "true" }
Stopped agent
{ "status": "false" }

/api/v1/ai-agents/{agentId}/stop

postStop an AI agent
This endpoint is used to stop an AI agent. Not related to the status found in the AI agent object. This will pause your AI agent, so it won't be able to process any requests. A 200 status code is returned if the agent is successfully stopped.

Parameters:

  • agentId* (path) - AI agent's id

Responses:

Status: 200
Stop an AI agent

/api/v2/ai-agents

postCreate an AI agent
This endpoint is used to create an AI agent without instantiating it. Create an AI agent by providing a name, a project id, and a valid Eliza character configuration file. You can also optionally provide an avatar for the agent.

Request Body:

Required.
application/json
Examples:
Example w/ avatar{ "avatar": "dGVzdGltYWdlZGF0YQ==", "config": "{\"name\":\"TestforFleekDraft\",\"plugins\":[],\"clients\":[\"telegram\"],\"modelProvider\":\"openai\",\"settings\":{\"secrets\":{\"OPENAI_API_KEY\":\"sk-xxxx\",\"TELEGRAM_BOT_TOKEN\":\"xxxx\"},\"voice\":{\"model\":\"en_US-male-medium\"}},\"bio\":[\"TestforFleek\"],\"lore\":[\"TestforFleek\"],\"knowledge\":[\"TestforFleek\"],\"messageExamples\":[[{\"user\":\"{{user1}}\",\"content\":{\"text\":\"TestforFleek\"}},{\"user\":\"Character\",\"content\":{\"text\":\"TestforFleek\"}}]],\"postExamples\":[\"TestforFleek\"],\"style\":{\"all\":[\"TestforFleek\"],\"chat\":[\"TestforFleek\"],\"post\":[\"TestforFleek\"]},\"topics\":[\"testforfleek\"],\"adjectives\":[\"testforfleek\"]}", "frameworkVersion": "1.0.0", "name": "My AI Agent", "projectId": "123" }
Example w/o avatar and frameworkVersion{ "config": "{\"foo\":\"valid Eliza character configuration\"}", "name": "My AI Agent", "projectId": "123" }

Responses:

Status: 201
Created draft AI agent
application/json
View Example
Example
{ "avatar": "dGVzdGltYWdlZGF0YQ==", "characterFile": "{\"name\":\"TestforFleekDraft\",\"plugins\":[],\"clients\":[\"telegram\"],\"modelProvider\":\"openai\",\"settings\":{\"secrets\":{\"OPENAI_API_KEY\":\"sk-xxxx\",\"TELEGRAM_BOT_TOKEN\":\"xxxx\"},\"voice\":{\"model\":\"en_US-male-medium\"}},\"bio\":[\"TestforFleek\"],\"lore\":[\"TestforFleek\"],\"knowledge\":[\"TestforFleek\"],\"messageExamples\":[[{\"user\":\"{{user1}}\",\"content\":{\"text\":\"TestforFleek\"}},{\"user\":\"Character\",\"content\":{\"text\":\"TestforFleek\"}}]],\"postExamples\":[\"TestforFleek\"],\"style\":{\"all\":[\"TestforFleek\"],\"chat\":[\"TestforFleek\"],\"post\":[\"TestforFleek\"]},\"topics\":[\"testforfleek\"],\"adjectives\":[\"testforfleek\"]}", "createdAt": "2021-01-01T00:00:00Z", "createdBy": "your_user_id", "frameworkName": "eliza", "frameworkVersion": "1.0.0", "id": "your_agent_id", "name": "Your Agent's Name", "projectId": "your_project_id", "status": "Draft", "updatedAt": "2021-01-01T00:00:00Z" }
Status: 402
Payment required
application/json