Skip to main content

Agents

LLMTune offers an Agent API for coding assistants: OpenAI-compatible chat with optional tools (read_file, write_file, list_directory, run_terminal, search_replace). Use it with Cursor, Continue.dev, or any OpenAI-compatible client. Tools are executed on your side; the API returns tool_calls for the client to run.

Base URL

Agent endpoints are served at:
https://api.llmtune.io/api/agent/v1
Use this as the base URL in Cursor, Continue, or your client. Authentication uses the same workspace API keys as the rest of the platform (Authorization: Bearer sk_...).

List models

Get the list of models available for the Agent API (Standard / inference-supported, non-confidential):
GET https://api.llmtune.io/api/agent/models
Optional query: ?active=false to include inactive models. Response shape:
{
  "success": true,
  "data": [
    { "id": "meta-llama/Llama-3.3-70B-Instruct", "name": "Llama 3.3 70B", "owned_by": "Meta" }
  ],
  "count": 1
}

Chat with tools

Send chat completions with optional tools:
POST https://api.llmtune.io/api/agent/v1/chat/completions
Headers:
  • Authorization: Bearer sk_YOUR_API_KEY
  • Content-Type: application/json
Request body (OpenAI-compatible):
{
  "model": "meta-llama/Llama-3.3-70B-Instruct",
  "messages": [{ "role": "user", "content": "Read src/index.ts" }],
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "read_file",
        "description": "Read file contents",
        "parameters": { "path": "string" }
      }
    }
  ],
  "tool_choice": "auto",
  "temperature": 0.7,
  "max_tokens": 1000
}
Response includes choices[].message with optional tool_calls. Execute each tool locally (e.g. in your IDE), then send the results back in a follow-up message.

Supported tools

Typical tools exposed for coding agents:
  • read_file – Read contents of a file
  • write_file – Write or overwrite a file
  • list_directory – List directory contents
  • run_terminal – Run a terminal command
  • search_replace – Search and replace in a file
Exact tool names and parameters may vary; use the model’s behavior or the in-app API Docs for the current list.

Errors

  • 401 – Invalid or missing API key
  • 503 – Agent/inference service not configured (check deployment and environment)
See Error codes for the standard error format.

Next steps