Skip to main content
GET
/
api
/
v1
/
agents
/
:name
/
key
Get Agent Key
curl --request GET \
  --url https://api.example.com/api/v1/agents/:name/key
{
  "keyPrefix": "<string>",
  "apiKey": "<string>",
  "pluginEndpoint": "<string>"
}
Retrieves the API key prefix for a specific agent. The full key is only shown in local mode.

Path Parameters

Response

keyPrefix
string
required
The first 12 characters of the agent’s API key (e.g., mnfst_ABCDE)
apiKey
string
The full API key. Only returned in local mode (MANIFEST_MODE=local).
pluginEndpoint
string
Custom OTLP endpoint URL. Only returned if PLUGIN_OTLP_ENDPOINT environment variable is set.

Example Request

curl https://api.manifest.build/api/v1/agents/my-agent/key \
  -H "Cookie: better-auth.session_token=YOUR_SESSION_TOKEN"

Example Response (Cloud Mode)

{
  "keyPrefix": "mnfst_ABCDE"
}

Example Response (Local Mode)

{
  "keyPrefix": "mnfst_ABCDE",
  "apiKey": "mnfst_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijk1234567890"
}

Example Response (With Custom Endpoint)

{
  "keyPrefix": "mnfst_ABCDE",
  "pluginEndpoint": "http://localhost:38238/otlp"
}

Error Responses

404 Not Found

Returned when:
  • The agent doesn’t exist
  • The agent doesn’t belong to the authenticated user
  • No active API key exists for the agent
{
  "statusCode": 404,
  "message": "No active API key found for this agent"
}

Notes

  • In cloud mode, only the key prefix is returned for security reasons
  • The key prefix is useful for identifying which key is in use without exposing the full secret
  • In local mode, the full key is shown to simplify development and testing
  • Use the /api/v1/agents/:name/rotate-key endpoint to generate a new key if the current one is compromised

Build docs developers (and LLMs) love