Waymore Docs

API Reference

Complete reference for the LLM Portal REST API. All endpoints use JSON request and response bodies unless otherwise noted.

Base URL: https://chat.waymore.ai/api

Authentication

The API supports two authentication methods: API Key (Bearer token) for programmatic access, and Session (cookie-based) for browser requests. Include your API key in the Authorization header.

cURL
1curl https://chat.waymore.ai/api/chat/completions \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "model": "Waymore-A1-Instruct-1011",
6 "messages": [{"role": "user", "content": "Hello"}]
7 }'

Auth Endpoints

POST
/api/auth/register

Register a new user account. Rate limited to 5 attempts per 15 minutes.

POST
/api/auth/verify-email

Verify email address with a token sent to the user's inbox.

POST
/api/auth/resend-verification

Resend the verification email. Rate limited to 3 per 5 minutes.

POST
/api/auth/forgot-password

Request a password reset link via email.

POST
/api/auth/reset-password

Reset password using a valid reset token.

Two-Factor Authentication

POST
/api/auth/2fa/setup

Generate a TOTP secret and QR code to enable 2FA.

POST
/api/auth/2fa/verify

Verify a TOTP token to complete 2FA setup. Returns backup codes.

POST
/api/auth/2fa/disable

Disable 2FA. Requires password and a valid token or backup code.

Register Request

POST /api/auth/register
1{
2 "name": "John Doe",
3 "email": "john@example.com",
4 "password": "SecureP@ssw0rd!"
5}
Response 201
1{
2 "id": "clx...",
3 "name": "John Doe",
4 "email": "john@example.com",
5 "requiresVerification": true
6}

2FA Setup Response

Response 200
1{
2 "secret": "JBSWY3DPEHPK3PXP",
3 "qrCode": "data:image/png;base64,...",
4 "otpauthUrl": "otpauth://totp/LLMPortal:john@example.com?..."
5}

Chat Completions

Send messages to AI models and receive streaming or non-streaming responses. Supports Bearer token and session authentication. Timeout is 5 minutes.

POST
/api/chat/completions

Create a chat completion. Supports streaming via SSE.

Request

POST /api/chat/completions
1{
2 "model": "Waymore-A1-Instruct-1011",
3 "messages": [
4 { "role": "system", "content": "You are a helpful assistant." },
5 { "role": "user", "content": "Explain quantum computing." }
6 ],
7 "stream": true,
8 "temperature": 0.7,
9 "session_id": "clx..."
10}

Non-Streaming Response

Response 200
1{
2 "id": "chatcmpl-abc123",
3 "model": "Waymore-A1-Instruct-1011",
4 "choices": [
5 {
6 "message": {
7 "role": "assistant",
8 "content": "Quantum computing uses..."
9 },
10 "finish_reason": "stop"
11 }
12 ],
13 "usage": {
14 "prompt_tokens": 25,
15 "completion_tokens": 150,
16 "total_tokens": 175
17 }
18}

Streaming Response (SSE)

Event Stream
1data: {"id":"chatcmpl-abc123","choices":[{"delta":{"content":"Quantum"},"index":0}]}
2 
3data: {"id":"chatcmpl-abc123","choices":[{"delta":{"content":" computing"},"index":0}]}
4 
5data: [DONE]

Function Calling

Extend the model with custom functions (tools) that it can invoke during a conversation. The API supports both OpenAI and Anthropic tool formats natively — the format is auto-detected from your request. Supports parallel tool calls.

Tool Definitions

Each tool has a type: "function" wrapper with parameters:

POST /api/chat/completions (OpenAI format)
1{
2 "model": "Waymore-A1-Instruct-1011",
3 "messages": [
4 {"role": "user", "content": "What is the weather in Athens, Greece?"}
5 ],
6 "tools": [
7 {
8 "type": "function",
9 "function": {
10 "name": "get_weather",
11 "description": "Get the current weather for a given location",
12 "parameters": {
13 "type": "object",
14 "properties": {
15 "location": {
16 "type": "string",
17 "description": "The city and country, e.g. Athens, Greece"
18 },
19 "unit": {
20 "type": "string",
21 "enum": ["celsius", "fahrenheit"],
22 "description": "Temperature unit"
23 }
24 },
25 "required": ["location"]
26 }
27 }
28 }
29 ],
30 "tool_choice": "auto"
31}

Tool Call Responses

Response includes tool_calls and finish_reason: "tool_calls".

Response 200 (OpenAI format)
1{
2 "id": "chatcmpl-abc123",
3 "model": "Waymore-A1-Instruct-1011",
4 "choices": [
5 {
6 "index": 0,
7 "message": {
8 "role": "assistant",
9 "content": "I'll check the current weather in Athens, Greece for you.",
10 "tool_calls": [
11 {
12 "id": "functions.get_weather:0",
13 "index": 0,
14 "type": "function",
15 "function": {
16 "name": "get_weather",
17 "arguments": "{"location": "Athens, Greece"}"
18 }
19 }
20 ]
21 },
22 "finish_reason": "tool_calls"
23 }
24 ],
25 "usage": {
26 "prompt_tokens": 885,
27 "completion_tokens": 33,
28 "total_tokens": 918
29 }
30}

Submitting Tool Results

Send the result as a message with role: "tool" and the matching tool_call_id.

POST /api/chat/completions (OpenAI format)
1{
2 "model": "Waymore-A1-Instruct-1011",
3 "messages": [
4 {"role": "user", "content": "What is the weather in Athens, Greece?"},
5 {
6 "role": "assistant",
7 "content": "I'll check the current weather in Athens, Greece for you.",
8 "tool_calls": [
9 {
10 "id": "functions.get_weather:0",
11 "type": "function",
12 "function": {
13 "name": "get_weather",
14 "arguments": "{"location": "Athens, Greece"}"
15 }
16 }
17 ]
18 },
19 {
20 "role": "tool",
21 "tool_call_id": "functions.get_weather:0",
22 "content": "{"temperature": 18, "unit": "celsius", "condition": "Partly cloudy", "humidity": 55}"
23 }
24 ],
25 "tools": [...]
26}

Format Comparison

ConceptOpenAI FormatAnthropic Format
Tool definitiontype: "function", function: { parameters }name, input_schema
Tool calltool_calls arraytool_use content blocks
Stop signalfinish_reason: "tool_calls"stop_reason: "tool_use"
Tool resultrole: "tool" + tool_call_idtool_result content block + tool_use_id
ArgumentsJSON string in argumentsParsed object in input

Parallel Tool Calls

The model can invoke multiple tools in a single response. Each tool call has a unique id and index. Submit all results before the next completion request.

Response with parallel tool calls
1{
2 "choices": [
3 {
4 "message": {
5 "role": "assistant",
6 "content": "I'll check the weather for both cities.",
7 "tool_calls": [
8 {
9 "id": "functions.get_weather:0",
10 "index": 0,
11 "type": "function",
12 "function": {
13 "name": "get_weather",
14 "arguments": "{"location": "Athens, Greece"}"
15 }
16 },
17 {
18 "id": "functions.get_weather:1",
19 "index": 1,
20 "type": "function",
21 "function": {
22 "name": "get_weather",
23 "arguments": "{"location": "London, United Kingdom"}"
24 }
25 }
26 ]
27 },
28 "finish_reason": "tool_calls"
29 }
30 ]
31}

tool_choice Options

ValueBehavior
"auto"Model decides whether to call a tool (default)
"none"Model will not call any tools
"required"Model must call at least one tool
{"type":"function","function":{"name":"..."}}Force a specific function to be called

Chat Sessions

Manage chat sessions (conversations). Sessions group messages together and track the model being used.

GET
/api/chat/sessions

List all chat sessions for the current user (50 most recent).

POST
/api/chat/sessions

Create a new chat session with optional title and model.

PATCH
/api/chat/sessions/:sessionId

Update a session's title or model.

DELETE
/api/chat/sessions/:sessionId

Delete a chat session and all its messages.

Create Session

POST /api/chat/sessions
1{
2 "title": "Quantum Physics Discussion",
3 "model": "Waymore-A1-Instruct-1011"
4}
Response 201
1{
2 "id": "clx...",
3 "title": "Quantum Physics Discussion",
4 "model": "Waymore-A1-Instruct-1011",
5 "messages": []
6}

Chat Messages

Create, retrieve, and manage messages within chat sessions. Messages support file attachments and ratings.

GET
/api/chat/sessions/:sessionId/messages

List all messages in a session with attachments.

POST
/api/chat/messages

Create a new message with optional attachments.

PATCH
/api/chat/messages/:messageId

Update a message (e.g. video data).

POST
/api/chat/messages/:messageId/rating

Rate an assistant message (thumbs up/down).

POST
/api/chat/attachments

Upload files for chat messages (max 5 files, 50MB each).

Create Message

POST /api/chat/messages
1{
2 "sessionId": "clx...",
3 "role": "user",
4 "content": "What is machine learning?",
5 "model": "Waymore-A1-Instruct-1011",
6 "attachments": [
7 { "name": "data.csv", "type": "text/csv", "size": 1024, "url": "/uploads/..." }
8 ]
9}
Response 201
1{
2 "id": "clx...",
3 "sessionId": "clx...",
4 "role": "user",
5 "content": "What is machine learning?",
6 "attachments": [...],
7 "totalTokens": 12
8}

Rate Message

POST /api/chat/messages/:messageId/rating
1{
2 "rating": "up"
3}
Response 200
1{
2 "success": true,
3 "rating": 1
4}

Models

Retrieve the list of available LLM models.

GET
/api/chat/models

Get all available LLM models and their providers.

Response

GET /api/chat/models — Response 200
1{
2 "data": [
3 { "id": "Waymore-A1-Instruct-1011", "owned_by": "waymore" }
4 ]
5}

API Keys

Programmatically create, list, rotate, and revoke API keys. Keys support granular permissions, IP whitelisting, and rate limits. The number of keys allowed depends on your subscription plan.

GET
/api/keys

List all API keys for the current user.

POST
/api/keys

Create a new API key with permissions and limits.

GET
/api/keys/:keyId

Get API key details.

PATCH
/api/keys/:keyId

Update API key metadata, permissions, and limits.

DELETE
/api/keys/:keyId

Delete an API key permanently.

POST
/api/keys/:keyId/regenerate

Regenerate the API key secret. Old key is invalidated.

POST
/api/keys/:keyId/revoke

Revoke an API key with an optional reason.

POST
/api/keys/:keyId/reactivate

Reactivate a previously revoked API key.

GET
/api/keys/:keyId/usage?days=30

Get usage statistics for an API key over a time period.

GET
/api/keys/:keyId/requests?limit=10

Get request history (daily aggregated) for an API key.

Create Key

POST /api/keys
1{
2 "name": "Production Key",
3 "description": "Main production API key",
4 "permissions": ["chat", "images", "vision"],
5 "ipWhitelist": ["203.0.113.0/24"],
6 "dailyLimit": 10000,
7 "monthlyLimit": 250000,
8 "rpmLimit": 60,
9 "expiresInDays": 90
10}
Response 201
1{
2 "id": "clx...",
3 "name": "Production Key",
4 "key": "sk-live-abc123...",
5 "status": "ACTIVE",
6 "tier": "PRO"
7}

Key Usage

GET /api/keys/:keyId/usage?days=30 — Response 200
1{
2 "apiKey": {
3 "id": "clx...",
4 "name": "Production Key",
5 "totalTokensUsed": 125000
6 },
7 "dailyUsage": [
8 { "date": "2025-01-15", "requests": 340, "tokens": 45000, "cost": 1.35, "errors": 2 }
9 ],
10 "stats": {
11 "totalRequests": 5200,
12 "totalTokens": 125000,
13 "avgResponseTime": 850
14 }
15}

Usage & Analytics

Retrieve detailed usage metrics with filtering by time period, API key, model, and status. Includes cost breakdowns and model-level analytics.

GET
/api/usage/summary

Get detailed usage summary with advanced filtering.

GET
/api/usage/filters

Get available filter options (keys, models) for usage queries.

Usage Summary

cURL
1curl https://chat.waymore.ai/api/usage/summary?period=30d&model=Waymore-A1-Instruct-1011 \
2 -H "Authorization: Bearer YOUR_API_KEY"
Response 200
1{
2 "stats": {
3 "totalRequests": 12500,
4 "totalTokens": 3200000,
5 "inputTokens": 1200000,
6 "outputTokens": 2000000,
7 "totalCost": 48.50,
8 "avgResponseTime": 920,
9 "errorCount": 15,
10 "errorRate": 0.12
11 },
12 "dailyUsage": [
13 { "date": "2025-01-15", "requests": 420, "tokens": 105000, "cost": 1.65, "errors": 1 }
14 ],
15 "byModel": [
16 {
17 "model": "Waymore-A1-Instruct-1011",
18 "requests": 8500,
19 "tokens": 2400000,
20 "cost": 38.40,
21 "percentage": 79.2
22 }
23 ],
24 "costBreakdown": {
25 "inputTokensCost": 12.00,
26 "outputTokensCost": 30.00,
27 "imagesCost": 6.50,
28 "total": 48.50
29 }
30}

Billing

Manage subscriptions, view invoices, and handle payment methods. Billing is powered by Stripe.

GET
/api/billing

Get billing overview: subscription, usage, payment methods, invoices.

GET
/api/billing/plans

List all available subscription plans with feature comparison.

GET
/api/billing/change-plan?planId=...

Preview a plan change with proration details.

POST
/api/billing/change-plan

Change subscription plan.

POST
/api/billing/cancel

Cancel subscription (effective at period end).

GET
/api/billing/invoices?limit=20&offset=0

Get paginated list of invoices.

GET
/api/billing/payment-methods

List all payment methods on file.

POST
/api/billing/payment-methods

Add a new payment method via Stripe payment method ID.

PATCH
/api/billing/payment-methods/:id

Update a payment method (e.g. set as default).

DELETE
/api/billing/payment-methods/:id

Remove a payment method.

Billing Overview

GET /api/billing — Response 200
1{
2 "subscription": {
3 "id": "clx...",
4 "status": "ACTIVE",
5 "plan": { "name": "Pro", "tier": "PRO" },
6 "currentPeriod": { "start": "2025-01-01", "end": "2025-02-01" },
7 "cancelAtPeriodEnd": false
8 },
9 "usage": {
10 "tokensUsed": 125000,
11 "tokensLimit": 500000,
12 "percentUsed": 25
13 },
14 "paymentMethods": [
15 { "id": "pm_...", "brand": "visa", "last4": "4242", "isDefault": true }
16 ],
17 "recentInvoices": [...]
18}

Available Plans

GET /api/billing/plans — Response 200
1{
2 "plans": [
3 {
4 "id": "clx...",
5 "name": "Free",
6 "tier": "FREE",
7 "monthlyPrice": 0,
8 "features": { "tokens": "1,000/mo", "apiKeys": 1 }
9 },
10 {
11 "id": "clx...",
12 "name": "Pro",
13 "tier": "PRO",
14 "monthlyPrice": 2900,
15 "yearlyPrice": 24900,
16 "features": { "tokens": "50,000/mo", "apiKeys": 10, "support": "Priority" }
17 }
18 ],
19 "currentPlanId": "clx...",
20 "features": [
21 { "name": "Monthly Tokens", "values": { "FREE": "1,000", "PRO": "50,000" } }
22 ]
23}

User Profile

View and update user profile information and change passwords.

GET
/api/user/profile

Get the current user's profile information.

PATCH
/api/user/profile

Update profile fields (name, email, company, phone, timezone).

POST
/api/user/password

Change password. Requires current password and a strong new password (min 12 chars).

Profile Response

GET /api/user/profile — Response 200
1{
2 "id": "clx...",
3 "name": "John Doe",
4 "email": "john@example.com",
5 "role": "USER",
6 "status": "ACTIVE",
7 "firstName": "John",
8 "lastName": "Doe",
9 "company": "Acme Inc",
10 "timezone": "America/New_York",
11 "twoFactorEnabled": true,
12 "createdAt": "2025-01-01T00:00:00Z"
13}

Files & Uploads

Upload and manage files. File endpoints proxy to the LLM backend for processing. Supports images, videos, PDFs, documents, and code files up to 50MB.

GET
/api/files

List uploaded files.

POST
/api/files/upload

Upload a file for LLM processing (multipart/form-data).

GET
/api/files/:fileId

Get file metadata.

DELETE
/api/files/:fileId

Delete an uploaded file.

Content Items

Save and organize content items (images, videos, files, code snippets, conversations, notes) in your personal library. Supports tagging, favorites, archiving, and full-text search.

GET
/api/stuff

List content items with filtering, search, and pagination.

POST
/api/stuff

Create a new content item.

GET
/api/stuff/:id

Get a content item with its collections.

PATCH
/api/stuff/:id

Update item metadata (title, description, tags, favorite, archive).

DELETE
/api/stuff/:id

Delete a content item permanently.

GET
/api/stuff/stats

Get aggregated content statistics and storage usage.

POST
/api/stuff/upload

Upload files to your library (multipart/form-data, max 50MB).

GET
/api/stuff/download/:userId/:filename

Download a file with caching support.

Query Parameters

cURL
1curl "https://chat.waymore.ai/api/stuff?type=IMAGE&search=photo&favorite=true&sortBy=newest&page=1&limit=20" \
2 -H "Authorization: Bearer YOUR_API_KEY"
3 
4# Supported types: IMAGE, VIDEO, FILE, CODE, CONVERSATION, NOTE
5# Sort options: newest, oldest, name_asc, name_desc, size
6# Filters: type, search, source, favorite, archived, collectionId

Content Stats

GET /api/stuff/stats — Response 200
1{
2 "total": 145,
3 "images": 52,
4 "videos": 8,
5 "files": 30,
6 "code": 25,
7 "conversations": 20,
8 "notes": 10,
9 "storageUsed": 524288000,
10 "storageLimit": 5368709120
11}

Collections

Organize content items into collections with custom colors and icons.

GET
/api/collections

List all collections with item counts.

POST
/api/collections

Create a new collection.

GET
/api/collections/:id

Get a collection with all its items.

PATCH
/api/collections/:id

Update collection metadata (name, description, color, icon).

DELETE
/api/collections/:id

Delete a collection (not allowed for default collections).

POST
/api/collections/:id/items

Add a content item to a collection.

DELETE
/api/collections/:id/items?itemId=...

Remove a content item from a collection.

Canvas Documents

Manage collaborative canvas documents linked to chat sessions. Supports version history with up to 50 snapshots.

GET
/api/canvas/:sessionId

Load a canvas document and recent versions for a session.

PUT
/api/canvas/:sessionId

Create or update (upsert) a canvas document.

DELETE
/api/canvas/:sessionId

Delete a canvas document and all its versions.

GET
/api/canvas/:sessionId/versions

List all version snapshots.

POST
/api/canvas/:sessionId/versions

Create a new version snapshot (max 50, oldest auto-deleted).

Errors

The API uses standard HTTP status codes. Error responses include a JSON body with details.

Error Response
1{
2 "error": "Descriptive error message"
3}
CodeDescription
200Success
201Created
400Bad request — invalid parameters or validation error
401Unauthorized — missing or invalid authentication
403Forbidden — insufficient permissions
404Not found — resource does not exist
409Conflict — resource already exists
429Too many requests — rate limit exceeded
500Internal server error

Rate Limits

EndpointLimit
/api/auth/register5 per 15 minutes per IP
/api/auth/resend-verification3 per 5 minutes per IP
/api/auth/forgot-password3 per 15 minutes per IP
/api/chat/completionsPer API key RPM limit (configurable)
Updated February 2026