POST
/
action
/
invoke_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": 200,
  "response": "An AI agent is a software entity that performs tasks autonomously using artificial intelligence techniques. It perceives its environment through sensors, processes the information, and takes actions to achieve specific goals. AI agents can range from simple programs that perform basic tasks to complex systems capable of learning and adapting to new situations. They are used in various applications, including virtual assistants, autonomous vehicles, recommendation systems, and more. AI agents can be classified based on their capabilities, such as reactive agents, which respond to stimuli without internal state, and cognitive agents, which have memory and reasoning abilities."
}

Authorizations

Authorization
string
header
required

Bearer token from your account (https://agent.ai/user/settings#credits)

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.

llm_engine
enum<string>
default:
gpt4o
required

LLM model to use for text generation.

Available options:
auto,
gpt4o,
gpt-4o-mini,
o1,
o1-mini,
o3-mini,
gpt_4v,
claude_sonnet_35,
claude_sonnet_35_vision,
claude_opus,
perplexity,
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

Response

200 - application/json
Use GenAI (LLM)
status
integer

HTTP status code of the action response

response
object

Response data from the action