LoopGpt API Documentation

API for model discovery and chat requests only. Every chat request is billed to the API key owner points balance.

Base URL: https://loopgpt.net API Key Auth Rate-Limited JSON Responses

Quick Start

From zero to first chat response in three steps.

1. Create API Key

Create it from your dashboard settings page.

2. Add Auth Header

Send X-API-Key: YOUR_API_KEY.

3. Send Chat Message

Call POST /api/v1/chat/send with model_id and message.

Required Headers

All protected endpoints require an API key.

X-API-Key: YOUR_API_KEY
Accept: application/json
Content-Type: application/json

API keys are account-linked and validated on each request. API chat conversations are stored separately from website chat UI conversations.

Public Endpoints

No auth required for model discovery endpoints.

Method Endpoint Description
GET /api/models List models with filters (q, category, type, page).
GET /api/models/{id_or_slug} Get safe model details and capabilities.
GET /api/categories List active model categories.

Chat Endpoints (Authenticated)

All endpoints below require a valid API key.

Method Endpoint Description
POST /api/v1/chat/send Send a chat prompt and return the model response.

Rate Limits

Rate limits and points checks are enforced per API key owner.

Global Limit

Platform-level request-per-minute protection.

Per-Key Limit

Each key has custom rate_limit (requests/min).

Points Billing

Each chat call deducts points from the API key owner account. If balance is insufficient, response is No points remaining.

Error Codes

Standard HTTP status codes used across API responses.

400
Invalid input payload
401
Missing/invalid API key
403
Forbidden or blocked
404
Resource not found
422
Validation failed
429
Rate limit exceeded or no points

Request Examples

Ready-to-run request examples in cURL, Python, and PHP.

1) cURL - List Models

curl "https://loopgpt.net/api/models?page=1&q=chat"

2) Send Chat Message (Choose Language)

import requests

base_url = "https://loopgpt.net"
api_key = "YOUR_API_KEY"

payload = {
    "model_id": 1,
    "message": "Hello from API"
}

r = requests.post(
    f"{base_url}/api/v1/chat/send",
    json=payload,
    headers={
        "X-API-Key": api_key,
        "Content-Type": "application/json",
        "Accept": "application/json"
    },
    timeout=30
)

print(r.status_code)
print(r.json())

Response Examples

All API responses are JSON. Use these examples as your parser contract.

1) Success (`200`)

{
  "success": true,
  "message": "Success",
  "data": {
    "conversation_id": 123,
    "assistant_message_id": 456,
    "response": "Hello! How can I help you today?",
    "message": "Hello! How can I help you today?",
    "usage": {
      "tokens": 82,
      "latency_ms": 642,
      "cost": 1
    }
  }
}

2) Invalid API Key (`401`)

{
  "success": false,
  "message": "Invalid API key"
}

3) No Points Remaining (`429`)

{
  "success": false,
  "message": "No points remaining"
}

4) Validation Error (`400`)

{
  "success": false,
  "message": "Message cannot be empty"
}