S
SaShi 1.0 API Reference
v1.0.0
OpenAI SDK Compatible Web Interface ↗

SaShi 1.0 Developer API

Welcome to Bharat's premier sovereign AI platform. The SaShi 1.0 API is 100% OpenAI-compatible, allowing you to use existing OpenAI client SDKs, LangChain, LlamaIndex, or raw HTTP requests without changing your application code.

Base URL

https://shiftontrend.com/v1

Authentication

All API requests require a valid Developer API Key. Pass your key in the Authorization header as a Bearer token, or in the x-api-key header.

HTTP Header
Authorization: Bearer sashi_live_YOUR_KEY_HERE

Deterministic IST Clock Rate Limits

SaShi 1.0 operates on transparent, deterministic **Indian Standard Time (IST)** clock buckets:

  • Clock-Minute RPM (e.g. 16:48:00 - 16:48:59 IST): Exact 60 requests allocated per clock minute. Automatically resets at the start of the next minute (e.g. 16:49:00 IST).
  • Calendar Day RPD: Enforces daily request quotas that automatically reset at 00:00:00 IST.
  • Standard Rate Limit Headers: Every API response returns x-ratelimit-remaining-requests-per-minute and x-ratelimit-reset-requests-per-minute.

Key Quota & Usage Analytics

GET /v1/key/usage

Inspect your API Key's allocated limits, current minute's IST consumption, today's RPD usage, and exact reset seconds.

cURL Example

curl https://shiftontrend.com/v1/key/usage \
  -H "Authorization: Bearer sashi_live_YOUR_KEY_HERE"

Response Example (JSON)

{
  "status": "active",
  "key": "sashi_live_ddcefd3cb1908d4ee9c9865c6b2988906ddd7aaa",
  "name": "test",
  "rpm": {
    "limit": 60,
    "used": 1,
    "remaining": 59,
    "current_minute": "16:48 IST (2026-09-15 16:48)",
    "resets_in_seconds": 18,
    "resets_at": "16:49:00 IST"
  },
  "rpd": {
    "limit": 5000,
    "used": 14,
    "remaining": 4986,
    "current_date": "2026-09-15 IST",
    "resets_at": "2026-09-16 00:00:00 IST"
  },
  "total_requests": 84,
  "server_time_ist": "2026-09-15 16:48:42 IST"
}

Chat Completions

POST /v1/chat/completions

Generates intelligent conversational text completions with full real-time streaming (SSE) support.

Request Body (JSON)

FieldTypeRequiredDescription
messagesArray<Object>YesArray of message objects with role and content.
modelStringOptionalDefaults to "sashi-1.0".
streamBooleanOptionalSet to true for token-by-token Server-Sent Events.
temperatureFloatOptionalControls randomness (0.0 to 1.0, default 0.6).
max_tokensIntegerOptionalMaximum tokens to generate (default 512).

Image Generations

POST /v1/images/generations

Generates photorealistic 1024x1024 visuals delivered directly in Base64 encoding.

Request Body (JSON)

FieldTypeDescription
promptStringThe visual prompt description.
sizeStringImage resolution (e.g. "1024x1024").
response_formatString"url" (Base64 Data URI) or "b64_json".

SDK Code Examples

Python (OpenAI SDK)

from openai import OpenAI

client = OpenAI(
    base_url="https://shiftontrend.com/v1",
    api_key="sashi_live_YOUR_KEY_HERE"
)

response = client.chat.completions.create(
    model="sashi-1.0",
    messages=[
        {"role": "user", "content": "Explain quantum computing in 2 lines."}
    ],
    stream=True
)

for chunk in response:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

JavaScript / Node.js (OpenAI SDK)

import OpenAI from 'openai';

const openai = new OpenAI({
  baseURL: 'https://shiftontrend.com/v1',
  apiKey: 'sashi_live_YOUR_KEY_HERE'
});

async function main() {
  const stream = await openai.chat.completions.create({
    model: 'sashi-1.0',
    messages: [{ role: 'user', content: 'Namaste SaShi!' }],
    stream: true,
  });

  for await (const chunk of stream) {
    process.stdout.write(chunk.choices[0]?.delta?.content || '');
  }
}

main();

cURL Command

curl -X POST https://shiftontrend.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sashi_live_YOUR_KEY_HERE" \
  -d '{
    "model": "sashi-1.0",
    "messages": [{"role": "user", "content": "Hello SaShi!"}],
    "stream": false
  }'

Status & Error Codes

StatusError CodeReason
200 OKsuccessRequest processed successfully.
401 Unauthorizedinvalid_api_keyMissing or invalid Developer API Key.
403 Forbiddenip_forbiddenClient IP is not in the key's IP allowlist.
429 Rate Limitrate_limit_exceededRPM or RPD limit has been reached for this key.