Skip to content

Quick Start Guide

This guide will help you get started with the OpenTyphoon.ai API quickly. The API is compatible with OpenAI’s API format, making it easy to integrate if you’re already familiar with OpenAI.

Get your API Key

  1. Sign up at OpenTyphoon.ai
  2. Navigate to the API Keys section in your dashboard
  3. Create a new API key
  4. Store your API key securely - it won’t be shown again!

Make your first API call

Terminal window
curl --location 'https://api.opentyphoon.ai/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--data '{
"model": "typhoon-v2.1-12b-instruct",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant. You must answer only in Thai."
},
{
"role": "user",
"content": "ขอสูตรไก่ย่าง"
}
],
"max_tokens": 512,
"temperature": 0.6,
"top_p": 0.95,
"repetition_penalty": 1.05,
"stream": false
}'

Using Typhoon OCR

For document parsing and OCR tasks, you can use our specialized typhoon-ocr model:

# Install the package
pip install typhoon-ocr
# Use the OCR function
from typhoon_ocr import ocr_document
# Please set env TYPHOON_OCR_API_KEY or OPENAI_API_KEY to use this function
markdown = ocr_document("test.png")
print(markdown)

The OCR model will process your document and return the extracted text in markdown format. It’s optimized for Thai text recognition and document structure preservation.

For optimal results with Typhoon models, we recommend the following parameter settings:

ParameterRecommended ValueDescription
temperature0.6Controls randomness. Lower values like 0.2 for factual/consistent responses, higher (0.8+) for more creative ones.
max_tokens512Adjust based on how long you expect the response to be.
top_p0.95Alternative to temperature for controlling randomness.
repetition_penalty1.05Prevents repetitive text. Increase slightly (1.1-1.2) if you notice repetition.

Next Steps

  • Check out our API Reference for detailed endpoint documentation
  • Explore Examples for common use cases
  • Read about Prompting to get better results
  • Learn about Models to understand which model is best for your needs