Developer Documentation

Build on Line AI

API-first platform for building AI-powered applications. Chat, agents, voice, integrations, memory, and more—all through a unified API.

Base URL: https://api.getline.ai/v1

Quick Start

Up and running in minutes

1

Get API Key

Generate an API key from your dashboard settings.

# Dashboard
Settings → API Keys → Generate
2

Install SDK

Install the official SDK for your platform.

# npm
npm install @lineai/sdk
# Python
pip install lineai
3

Make API Call

Start building with any of our APIs.

const client = new LineAI()
const result = await
  client.chat.complete({...})

Complete Example

import { LineAI } from '@lineai/sdk';

const client = new LineAI({
  apiKey: process.env.LINEAI_API_KEY
});

// Chat completion
const chat = await client.chat.complete({
  model: 'claude-3-5-sonnet',
  messages: [{ role: 'user', content: 'Hello!' }]
});

// Invoke an agent
const result = await client.agents.invoke('agent_id', {
  input: 'Process this document',
  context: { documentId: 'doc_123' }
});

// Search memory
const memories = await client.memory.search({
  query: 'customer preferences',
  limit: 10
});
API Reference

Core APIs

Everything you need to build AI-powered applications.

Chat API

Multi-model streaming conversations with context management.

  • POST /chat/completions
  • POST /chat/stream

Agents API

Deploy, configure, and manage AI agents programmatically.

  • GET /agents
  • POST /agents
  • POST /agents/{id}/invoke

Voice API

Phone agent configuration, call management, and analytics.

  • GET /voice/agents
  • POST /voice/calls
  • GET /voice/analytics

Integrations API

900+ pre-built connectors with OAuth handling.

  • GET /integrations
  • POST /integrations/connect
  • POST /integrations/execute

Memory API

Semantic search and knowledge storage across your organization.

  • POST /memory/query
  • POST /memory/cards
  • GET /memory/search

Collections API

Document management with automatic indexing and retrieval.

  • GET /collections
  • POST /collections/documents
  • POST /collections/query

Scheduler API

Event orchestration, cron jobs, and workflow triggers.

  • POST /scheduler/jobs
  • GET /scheduler/runs
  • POST /scheduler/trigger

Agent Platform API

YAML task definitions, deployments, and execution.

  • POST /platform/tasks
  • POST /platform/deploy
  • GET /platform/runs
Authentication

API Keys & Bearer Tokens

All API requests require authentication via Bearer token in the Authorization header.

  • Generate API keys from your dashboard
  • Use separate keys for dev/staging/production
  • Scope keys to minimum required permissions
  • Rotate keys periodically for security

Rate Limits: 1,000 requests/hour standard, 10,000/hour for enterprise

# cURL example
curl -X POST https://api.getline.ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-3-5-sonnet",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'
Official SDKs

First-class SDK support

JavaScript / TypeScript

// Installation
npm install @lineai/sdk

// Usage
import { LineAI } from '@lineai/sdk';

const client = new LineAI({
  apiKey: process.env.LINEAI_API_KEY
});

// Streaming chat
const stream = await client.chat.stream({
  model: 'claude-3-5-sonnet',
  messages: [{ role: 'user', content: 'Hello!' }]
});

for await (const chunk of stream) {
  process.stdout.write(chunk.content);
}

Python

# Installation
pip install lineai

# Usage
from lineai import LineAI
import os

client = LineAI(
    api_key=os.environ['LINEAI_API_KEY']
)

# Streaming chat
stream = client.chat.stream(
    model='claude-3-5-sonnet',
    messages=[{'role': 'user', 'content': 'Hello!'}]
)

for chunk in stream:
    print(chunk.content, end='')

Webhooks

Real-time notifications for events across your organization.

Agent Events

  • • agent.invoked, agent.completed, agent.failed

Voice Events

  • • call.started, call.ended, call.transferred

Memory Events

  • • memory.created, memory.updated, collection.indexed
// Webhook payload example
{
  "event": "call.ended",
  "timestamp": "2025-01-20T14:30:00Z",
  "data": {
    "call_id": "call_abc123",
    "agent_id": "agent_xyz",
    "duration_seconds": 245,
    "outcome": "appointment_scheduled",
    "recording_url": "https://...",
    "transcript": "..."
  }
}
Resources

Everything you need to build

API Documentation

Interactive API reference with examples for every endpoint.

Explore docs

Example Projects

Sample code and starter templates for common use cases.

  • • Chat applications
  • • Agent integrations
  • • Voice workflows

Support

Get help when you need it.

  • • developers@getline.ai
  • • Response within 24 hours
  • • Priority support for enterprise

Start building today

Get API access and start building AI-powered applications in minutes.