⚠️ Note: Not all examples are tested yet. Please use with caution and report any issues.
This directory contains cURL command-line examples for using the Rahyana AI API. These examples are perfect for testing, automation, and quick API interactions.
- cURL installed (usually pre-installed on Linux/macOS)
- A Rahyana API key (get one at rahyana.ir)
-
Set your API key as an environment variable:
export API_KEY="your_api_key_here"
-
Run any example script:
chmod +x chat-completions/basic-chat.sh ./chat-completions/basic-chat.sh
basic-chat.sh- Simple chat completionstreaming-chat.sh- Streaming chat responsesimage-analysis.sh- Analyze images with AIaudio-processing.sh- Process audio filespdf-processing.sh- Analyze PDF documentsweb-search.sh- Web search integrationtool-calling.sh- Function calling examplesjson-mode.sh- Structured JSON responses
legacy-completions.sh- Text completion endpoint
get-models.sh- List available AI models
All scripts use the following environment variables:
API_KEY- Your Rahyana API key (required)BASE_URL- API base URL (defaults tohttps://rahyana.ir/api/v1)
export API_KEY="your_api_key_here"
./chat-completions/basic-chat.shexport API_KEY="your_api_key_here"
./chat-completions/streaming-chat.shexport API_KEY="your_api_key_here"
./chat-completions/image-analysis.shThese examples are provided as-is for educational purposes.