Skip to main content
v1.0 · REST API

SAPPLANTA API

The SAPPLANTA API allows you to integrate our multi-model AI platform into your own applications. Use it to build AI-powered products, automate workflows, and integrate AI into your applications.

Base URL

https://www.sapplanta.site/api

Authentication

All API requests require authentication using a Bearer token. Generate your API key from the Developer Dashboard.

Header

Authorization: Bearer sk-sap-your-key-here

API keys are only available on paid plans (Starter and above). Free plan users can use the web interface at sapplanta.site.

Chat

POST/api/chatAuth required

Send a message and receive an AI-generated response

Request Body

{
  "messages": [
    { "role": "user", "content": "Write a Laravel controller for products" }
  ],
  "domain": "laravel",        // optional: laravel|nextjs|python|react|node|mobile|swahili|general
  "model": "auto"             // optional: auto|reasoning|default
}

Response

{
  "content": "Here is a complete ProductController...",
  "model": "anthropic/claude-3.5-sonnet",
  "modelType": "reasoning",
  "creditsUsed": 5
}
GET/api/chatsAuth required

List all chat conversations for the authenticated user

Response

[
  {
    "id": "clx...",
    "title": "Laravel product controller",
    "createdAt": "2026-03-21T12:00:00Z",
    "updatedAt": "2026-03-21T12:05:00Z"
  }
]

Credits & Usage

GET/api/creditsAuth required

Get remaining credits for the authenticated user

Response

{
  "reasoningCredits": 145,
  "imageCredits": 48,
  "videoCredits": 7
}
GET/api/usageAuth required

Get today's usage stats for the authenticated user

Response

{
  "used": 12,
  "limit": 999999,
  "plan": "pro",
  "remaining": 999987
}

Image, Video & Music

POST/api/generate-imageAuth required

Generate an image using Flux Schnell AI (requires image credits)

Request Body

{
  "prompt": "Nairobi skyline at golden hour, photorealistic, 8K"
}

Response

{
  "imageUrl": "https://...",
  "creditsUsed": 2,
  "remainingCredits": 48
}
POST/api/generate-videoAuth required

Generate a short video using FAL.ai (Elite plan only)

Request Body

{
  "prompt": "A timelapse of Mount Kenya at sunrise"
}

Response

{
  "videoUrl": "https://...",
  "creditsUsed": 20
}

Rate Limits

PlanRequests/minDaily MessagesConcurrent
Trader30Unlimited3
Pro60Unlimited5
Elite120Unlimited10

Code Examples

JavaScript / Node.js
const response = await fetch('https://www.sapplanta.site/api/chat', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer sk-sap-your-key-here',
  },
  body: JSON.stringify({
    messages: [{ role: 'user', content: 'Write a REST API in FastAPI' }],
    domain: 'python',
  }),
})

const data = await response.json()
console.log(data.content)
Python
import requests

response = requests.post(
    'https://www.sapplanta.site/api/chat',
    headers={
        'Content-Type': 'application/json',
        'Authorization': 'Bearer sk-sap-your-key-here',
    },
    json={
        'messages': [{'role': 'user', 'content': 'Build a Laravel API with authentication'}],
        'domain': 'laravel',
    }
)

print(response.json()['content'])
PHP / Laravel
$response = Http::withHeaders([
    'Authorization' => 'Bearer sk-sap-your-key-here',
])->post('https://www.sapplanta.site/api/chat', [
    'messages' => [
        ['role' => 'user', 'content' => 'Generate an Eloquent model']
    ],
    'domain' => 'laravel',
]);

echo $response->json()['content'];
cURL
curl -X POST https://www.sapplanta.site/api/chat \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-sap-your-key-here" \
  -d '{
    "messages": [{"role": "user", "content": "Hello!"}],
    "domain": "general"
  }'

Error Codes

CodeMeaningCommon Cause
200SuccessRequest completed successfully
400Bad RequestMissing or invalid parameters
401UnauthorizedMissing or invalid API key
403ForbiddenPlan doesn't support this feature
404Not FoundResource does not exist
429Rate LimitedToo many requests — slow down
500Server ErrorSomething went wrong on our end
502Provider ErrorAI provider temporarily unavailable

CLI Tool

Use SAPPLANTA directly from your terminal. Works on Windows, Mac and Linux.

Install
npm install -g sapplanta

# Setup your API key
sapplanta login --key sk-or-v1-your-key
Usage Examples
# Interactive chat
sapplanta chat --domain laravel --mode elite

# Ask a question
sapplanta ask "Write a Laravel controller for products" --domain laravel

# Analyze a file
sapplanta analyze app.js --instruction "Fix the bugs" --mode elite

# Generate code to files
sapplanta generate "Build a restaurant website" --output ./my-site
sapplanta chat
sapplanta ask
sapplanta analyze
sapplanta generate

Ready to build?

Get your API key and start integrating in minutes