SDKs
How you call Shisa depends on the service. Shisa LLM is OpenAI-compatible, so you can use the official OpenAI SDKs as-is. ASR, TTS, and Translation have no dedicated SDK — you call them with a standard HTTP client. In every case, keep your API key in an environment variable rather than hard-coding it.
LLM — use the OpenAI SDKs
Shisa LLM speaks the OpenAI Chat Completions API. Install the official SDK, point the base URL at Shisa, and use the Shisa model name.
# Python
pip install openai
# Node.js
npm install openai
Set the base URL to https://api.shisa.ai/openai/v1 and use the model shisa-ai/shisa-v2.1-llama3.3-70b:
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.shisa.ai/openai/v1",
api_key=os.environ["SHISA_API_KEY"],
)
response = client.chat.completions.create(
model="shisa-ai/shisa-v2.1-llama3.3-70b",
messages=[{"role": "user", "content": "日本語で自己紹介をしてください。"}],
)
print(response.choices[0].message.content)
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.shisa.ai/openai/v1',
apiKey: process.env.SHISA_API_KEY,
});
const response = await client.chat.completions.create({
model: 'shisa-ai/shisa-v2.1-llama3.3-70b',
messages: [{ role: 'user', content: '日本語で自己紹介をしてください。' }],
});
console.log(response.choices[0].message.content);
The OpenAI SDKs also handle streaming and retry-on-429 for you. For a full walkthrough including curl, see the LLM quickstart.
ASR, TTS, and Translation — use a standard HTTP client
These services are plain HTTPS APIs and are not covered by the OpenAI SDK. Call them with requests in Python or fetch in Node — whatever HTTP client you already use. They use the same Authorization: Bearer YOUR_API_KEY header as the LLM API; see Authentication.
import os
import requests
response = requests.post(
"https://api.shisa.ai/translate/",
headers={"Authorization": f"Bearer {os.environ['SHISA_API_KEY']}"},
json={"text": "Hello", "target": "ja"},
)
print(response.json())
const response = await fetch('https://api.shisa.ai/tts/voices', {
headers: { Authorization: `Bearer ${process.env.SHISA_API_KEY}` },
});
const voices = await response.json();
console.log(voices);
For request and response details, start with each service's quickstart:
- Speech Recognition (ASR) — quickstart and endpoints reference.
- Text-to-Speech (TTS) — quickstart and endpoints reference.
- Translation — quickstart and endpoints reference.
Whichever client you use, load the API key from an environment variable such as SHISA_API_KEY rather than hard-coding it, and never ship it in client-side code. See Authentication.
Next steps
- Authentication — per-service header conventions.
- Errors — status codes and JSON error shapes.
- Rate limits — handling
429with backoff.