API Reference

Build powerful integrations with our comprehensive REST API. Access real-time agent management, conversation tracking, and webhook capabilities with simple, well-documented endpoints.

📡Base URL

https://api.One Last AI.com/v1

All API requests should be made to this base URL with proper versioning.

🔑Authentication

Authorization: Bearer YOUR_API_KEY

Include your API key in the Authorization header for all requests.

API Reference

Security

Authentication

Secure your API requests with OAuth 2.0 and API keys

Learn more →
Reference

Agents Endpoints

Create, retrieve, and manage AI agents through our REST API

Learn more →
Reference

Conversations API

Access and manage chat conversations and message history

Learn more →
Policy

Rate Limits

Understand rate limiting and throttling policies

Learn more →
Guide

Error Handling

Learn how to handle and debug API errors effectively

Learn more →
Integration

Webhooks

Set up real-time notifications for agent events

Learn more →

Authentication

Getting Your API Key

  1. 1

    Sign in to your account

    Log in to the One Last AI dashboard

  2. 2

    Navigate to API Settings

    Go to Settings → Developer → API Keys

  3. 3

    Generate a new API key

    Click "Create New Key" and copy your key

⚠️ Security Note: Keep your API keys confidential. Never commit them to version control or share publicly.

Agents Endpoints

GET/agents

Retrieve a list of all your agents

Response:

{ "data": [ { "id": "agent_123", "name": "Tech Wizard", "personality": "helpful", "created_at": "2025-01-15T10:30:00Z" } ], "total": 1 }
POST/agents

Create a new AI agent

Request:

{ "name": "New Agent", "personality": "friendly", "model": "gpt-4", "system_prompt": "You are a helpful assistant" }
GET/agents/[agent_id]

Retrieve details of a specific agent

Conversations API

POST/conversations

Send a message to an agent and get a response

Request:

{ "agent_id": "agent_123", "message": "How do I create an agent?", "conversation_id": "conv_456" // optional }
GET/conversations/[conversation_id]

Retrieve the full conversation history

Rate Limits

Standard Plan

  • Requests/minute:100
  • Daily limit:100,000
  • Concurrent requests:10

Pro Plan

  • Requests/minute:500
  • Daily limit:1,000,000
  • Concurrent requests:50

Code Examples

List All Agents

JavaScript
// Get all agents
const response = await fetch('https://api.One Last AI.com/v1/agents', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
});

const agents = await response.json();
console.log(agents);

Create an Agent

Python
import requests

# Create a new agent
response = requests.post(
  'https://api.One Last AI.com/v1/agents',
  headers={
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  json={
    'name': 'My Bot',
    'personality': 'helpful',
    'model': 'gpt-4'
  }
)

agent = response.json()
print(agent['id'])

Send Message

JavaScript
// Send a message to an agent
const response = await fetch('https://api.One Last AI.com/v1/conversations', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    agent_id: 'agent_123',
    message: 'Hello, how are you?'
  })
});

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

Error Handling

All API errors follow a standard format. Handle errors gracefully in your applications:

{ "error": { "code": "INVALID_API_KEY", "message": "The provided API key is invalid", "details": "Please check your API key and try again" } }
400

Bad Request

Invalid parameters or missing required fields

401

Unauthorized

API key is missing or invalid

429

Rate Limit Exceeded

You've exceeded the rate limit for your plan

500

Server Error

Internal server error - try again later

Webhooks

Subscribe to real-time events from your agents. Webhooks are triggered when specific events occur:

agent.created

Triggered when a new agent is created

agent.updated

Triggered when an agent is updated

message.received

Triggered when an agent receives a message

conversation.completed

Triggered when a conversation ends

Ready to Build?

Start integrating with our API today. Check out our tutorials and SDKs for different programming languages.