LLM Quickstart
This guide makes your first chat completion against Shisa LLM. You will need an API key — create one in the Shisa platform. New accounts include $10 in free credits.
1. Set your endpoint and key
Shisa LLM is OpenAI-compatible. Point any OpenAI client at the Shisa base URL and authenticate with a bearer token:
Base URL: https://api.shisa.ai/openai/v1
Auth: Authorization: Bearer YOUR_API_KEY
Model: shisa-ai/shisa-v2.1-llama3.3-70b
tip
Keep your API key out of source control. Read it from an environment variable (for example SHISA_API_KEY) in real applications.
2. Make a request
curl
curl -XPOST https://api.shisa.ai/openai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "shisa-ai/shisa-v2.1-llama3.3-70b",
"stream": true,
"messages": [
{
"role": "system",
"content": "You are a helpful assistant fluent in Japanese and English."
},
{
"role": "user",
"content": "日本の四季について教えてください。"
}
],
"temperature": 0.7
}'
Python
from openai import OpenAI
# Initialize client with Shisa AI endpoint
client = OpenAI(
base_url="https://api.shisa.ai/openai/v1",
api_key="YOUR_API_KEY"
)
def chat_with_shisa(message, model="shisa-ai/shisa-v2.1-llama3.3-70b"):
response = client.chat.completions.create(
model=model,
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": message}
],
stream=True,
temperature=0.7
)
for chunk in response:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
# Example usage
chat_with_shisa("東京でおすすめの観光スポットを教えてください。")
Node.js
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.shisa.ai/openai/v1',
apiKey: 'YOUR_API_KEY',
});
async function chatWithShisa(message) {
const stream = await client.chat.completions.create({
model: 'shisa-ai/shisa-v2.1-llama3.3-70b',
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: message }
],
stream: true,
temperature: 0.7,
});
for await (const chunk of stream) {
const content = chunk.choices[0]?.delta?.content || '';
process.stdout.write(content);
}
}
// Example usage
await chatWithShisa('日本語で自己紹介をしてください。');
3. Read the response
With "stream": true the API returns Server-Sent Events; each event carries a token in choices[0].delta.content. Set "stream": false to receive a single JSON response with the full message in choices[0].message.content. The response shape matches the OpenAI Chat Completions API — see the chat completions reference for the full schema.
Next steps
- Pick the right model for your workload in Models.
- See every supported parameter in the chat completions reference.
- Learn the auth header conventions across services in Authentication.