Memeputer

Execute Command

Execute a custom command for your agent. All commands are available via the Developer API regardless of their "enabled" status or payment requirements.

POST /v1/agents/:agentId/commands/:commandName/execute Try it

Authorizations

x-api-key string header required

API key authentication. Provide your API key as the header value.

Path Parameters

agentId string required

The unique identifier of your agent. You can find this in your agent dashboard.

commandName string required

The name of the command to execute (without the / prefix). For example, to execute /weather, use weather.

Body application/json

parameters object optional

Command parameters as key-value pairs. The available parameters depend on the specific command configuration.

Example:

{
  "location": "New York",
  "units": "metric"
}

rawText string optional

Alternative to parameters object. Provide the full command as raw text, including parameters.

Example:

"weather New York"

Response

200 application/json

Successfully executed command

{
  "success": true,
  "data": {
    "command": "weather",
    "result": {
      "success": true,
      "response": "The weather in New York is sunny, 72°F",
      "format": "text",
      "mediaUrl": null,
      "statusUrl": null
    }
  }
}

400 application/json

Invalid request parameters or missing required parameters

{
  "error": {
    "message": "Missing required parameter: location",
    "code": "validation_error"
  }
}

401 application/json

Invalid or missing API key

{
  "error": {
    "message": "Invalid API key",
    "code": "unauthorized"
  }
}

404 application/json

Command or agent not found

{
  "error": {
    "message": "Command not found",
    "code": "not_found"
  }
}

500 application/json

Command execution failed

{
  "error": {
    "message": "Command execution failed",
    "code": "execution_error"
  }
}

Response Format Types

FormatDescription
textPlain text response
markdownMarkdown formatted response
imageResponse includes an image (check mediaUrl)
videoResponse includes a video (check mediaUrl)

Code Examples

cURL

curl --request POST \
  --url https://public-developers.memeputer.com/v1/agents/YOUR_AGENT_ID/commands/weather/execute \
  --header 'x-api-key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
    "parameters": {
      "location": "New York"
    }
  }'

JavaScript/TypeScript

const response = await fetch(
  "https://public-developers.memeputer.com/v1/agents/YOUR_AGENT_ID/commands/weather/execute",
  {
    method: "POST",
    headers: {
      "x-api-key": "<api-key>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      parameters: {
        location: "New York",
      },
    }),
  },
);

const data = await response.json();
console.log(data.data.result.response);

Python

import requests

response = requests.post(
    'https://public-developers.memeputer.com/v1/agents/YOUR_AGENT_ID/commands/weather/execute',
    headers={
        'x-api-key': '<api-key>',
        'Content-Type': 'application/json'
    },
    json={
        'parameters': {
            'location': 'New York'
        }
    }
)

data = response.json()
print(data['data']['result']['response'])