Prompts

Process a prompt request

post

Processes a user prompt and returns an AI-generated response. The request must contain a valid API key.

Authorizations
Agent-Secret-KeystringRequired

Custom authentication header

Body
promptstringRequired

The question that the user sends to the AI agent

Example: How does quantum entanglement work?
Responses
200

Successfully processed the prompt and returned a response.

application/json
post
/external/prompts
POST /external/prompts HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 48

{
  "prompt": "How does quantum entanglement work?"
}
{
  "totalTokens": 12345,
  "response": "The theory of relativity explains how time and space are linked"
}

Create a prompt request

post

Creates a user prompt and returns an ID. The request must contain a valid API key.

Authorizations
Agent-Secret-KeystringRequired

Custom authentication header

Body
promptstringRequired

The question that the user sends to the AI agent

Example: How does quantum entanglement work?
Responses
200

Successfully created the prompt and returned an ID.

application/json
post
/external/prompts/async
POST /external/prompts/async HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 48

{
  "prompt": "How does quantum entanglement work?"
}
{
  "promptId": "1234567890"
}

Get a response on prompt request

get

Returns a response on a user prompt by ID. The request must contain a valid API key.

Authorizations
Agent-Secret-KeystringRequired

Custom authentication header

Path parameters
idstringRequired

Provide the prompt ID to process.

Example: 5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b
Responses
200

Successfully returned a response on the prompt. Returns null if the prompt is not ready.

application/json
get
/external/prompts/{id}/response-on
GET /external/prompts/{id}/response-on HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Accept: */*
{
  "totalTokens": 12345,
  "response": "The theory of relativity explains how time and space are linked"
}

Last updated