Skip to main content

SDKs

How you call Shisa depends on the language and service. Shisa LLM is OpenAI-compatible, so Python and JavaScript applications can use the official OpenAI SDKs as-is. Batch ASR, HTTP TTS, and Translation are plain HTTP APIs; realtime ASR and TTS are WebSocket APIs. The router repository also includes a Go client source package covering the HTTP APIs for all four services. 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.

Go — router client package​

The pkg/client package in the router repository provides typed clients for models/chat, batch ASR, TTS, and Translation, including streaming helpers. It is shipped as router source rather than a separately versioned SDK, so pin the router module revision you test.

Python and JavaScript — use standard HTTP or WebSocket clients for other services​

The batch ASR, HTTP TTS, and Translation endpoints 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. For realtime APIs, use a WebSocket client and follow the realtime ASR or TTS WebSocket protocol. Both transports 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']}"},
data={
"text": "Hello",
"source_lang": "en",
"target_lang": "ja",
},
)
response.raise_for_status()
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:

tip

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​