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
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.
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-minuteandx-ratelimit-reset-requests-per-minute.
Key Quota & Usage Analytics
GET /v1/key/usageInspect 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/completionsGenerates intelligent conversational text completions with full real-time streaming (SSE) support.
Request Body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
| messages | Array<Object> | Yes | Array of message objects with role and content. |
| model | String | Optional | Defaults to "sashi-1.0". |
| stream | Boolean | Optional | Set to true for token-by-token Server-Sent Events. |
| temperature | Float | Optional | Controls randomness (0.0 to 1.0, default 0.6). |
| max_tokens | Integer | Optional | Maximum tokens to generate (default 512). |
Image Generations
POST /v1/images/generationsGenerates photorealistic 1024x1024 visuals delivered directly in Base64 encoding.
Request Body (JSON)
| Field | Type | Description |
|---|---|---|
| prompt | String | The visual prompt description. |
| size | String | Image resolution (e.g. "1024x1024"). |
| response_format | String | "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
| Status | Error Code | Reason |
|---|---|---|
| 200 OK | success | Request processed successfully. |
| 401 Unauthorized | invalid_api_key | Missing or invalid Developer API Key. |
| 403 Forbidden | ip_forbidden | Client IP is not in the key's IP allowlist. |
| 429 Rate Limit | rate_limit_exceeded | RPM or RPD limit has been reached for this key. |