v1.0 · REST API

SAPPLANTA AI API

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

Base URL

https://www.sapplanta.site/api

Authentication

All API requests (except public marketplace browsing) 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/chat🔒 Auth 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|trading|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/chats🔒 Auth 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"
  }
]

Marketplace

GET/api/marketplace/products🌐 Public

Browse public marketplace products

Response

{
  "success": true,
  "data": {
    "products": [...],
    "total": 42,
    "page": 1,
    "pages": 2
  }
}
POST/api/marketplace/buy🌐 Public

Initiate a crypto payment to purchase a marketplace product

Request Body

{
  "productId": "clx...",
  "currency": "usdttrc20"   // usdttrc20|btc|eth|sol|ltc
}

Response

{
  "success": true,
  "data": {
    "paymentUrl": "https://nowpayments.io/payment/...",
    "orderId": "MKT-abc12345-1711234567",
    "price": 9.99,
    "platformFee": 2.00,
    "creatorProfit": 7.99
  }
}

Credits & Usage

GET/api/credits🔒 Auth required

Get remaining credits for the authenticated user

Response

{
  "reasoningCredits": 145,
  "imageCredits": 48,
  "videoCredits": 7
}
GET/api/usage🔒 Auth required

Get today's usage stats for the authenticated user

Response

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

Image & Video

POST/api/generate-image🔒 Auth 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-video🔒 Auth required

Generate a short video using FAL.ai (Creator/Team plan only)

Request Body

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

Response

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

Rate Limits

PlanRequests/minDaily MessagesConcurrent
Free10100/month1
Starter30Unlimited2
Pro60Unlimited3
Creator100Unlimited5
Team200Unlimited10

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': 'Write a trading bot strategy'}],
        'domain': 'trading',
    }
)

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

Ready to build?

Get your API key and start integrating in minutes