Skip to main content
POST
/
action
/
invoke_llm
Use GenAI (LLM)
curl --request POST \
  --url https://api-lr.agent.ai/v1/action/invoke_llm \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "instructions": "What is an AI agent?",
  "llm_engine": "gpt4o"
}
'
{
  "status": 123,
  "response": {}
}

Authorizations

Authorization
string
header
required

Bearer token from your account (https://agent.ai/user/integrations#api)

Body

application/json
instructions
string
required

Enter detailed instructions for the language model, such as 'Write a summary of the document' or 'Create an engaging email subject line.

Example:

"What is an AI agent?"

llm_engine
enum<string>
default:gpt4o
required

LLM model to use for text generation.

Available options:
auto,
gpt-5,
gpt-5-mini,
gpt-5-nano,
gpt-4.1,
gpt4o,
gpt-4o-mini,
o1,
o1-mini,
o1-pro,
o3-mini,
gpt_4v,
claude_sonnet_4.1,
claude_opus_4.1,
claude_sonnet_4,
claude_opus_4,
claude_sonnet_35,
claude_sonnet_35_vision,
claude_opus,
perplexity,
gemini-2.5-pro-preview-05-06,
gemini-2.5-flash-image-preview,
gemini-2.0-flash-exp-image-generation,
gemini-2.5-pro-exp-03-25,
gemini-2.0-pro-exp-02-05,
gemini-2.0-flash-exp,
gemini-2.0-flash-thinking-exp-1219,
gemini_15_pro,
gemini_15_flash,
gemma-7b-it,
gemma2-9b-it,
llama-3.3-70b-versatile,
deepseek-r1-distill-llama-70b,
mixtral-8x7b-32768,
gpt45,
meta-llama/llama-4-scout-17b-16e-instruct,
meta-llama/llama-4-maverick-17b-128e-instruct

Response

200 - application/json

Use GenAI (LLM)

status
integer<int32>

HTTP status code of the action response

response
object

Response data from the action