Prakasa API is fully compatible with the OpenAI API standard. This means you can use your favorite command-line tools to access Claude 3.5, GPT-4o, and Gemini Pro directly from your terminal.
Below are the configuration guides for the most popular open-source CLI tools.
1. AIChat (Recommended)
AIChat is a powerful, all-in-one CLI tool written in Rust. It features syntax highlighting, role management, and REPL mode.
Installation
macOS / Linux (Homebrew)
Bash
brew install aichat
Windows (Winget)
PowerShell
winget install aichat
Configuration
Run aichat once to generate the config file, then edit it:
Config Path:
macOS/Linux: ~/.config/aichat/config.yaml
Windows: %APPDATA%\aichat\config.yaml
Edit config.yaml:
YAML
Usage
Bash
2. Shell-GPT (sgpt)
Shell-GPT allows you to generate shell commands, code snippets, and documentation directly in your terminal using Python.
Installation
Requires Python 3.8+.
Bash
Configuration
Set the environment variables in your shell profile (~/.zshrc or ~/.bashrc):
Bash
Reload your shell:
Bash
Usage
Bash
3. LLM (Simon Willison's Tool)
LLM is a CLI utility and Python library for interacting with Large Language Models. It supports a plugin system for extended functionality.
Installation
Bash
Configuration
Configure the default OpenAI key to point to Prakasa:
Bash
Usage
Bash
4. Advanced: Curl (Raw Request)
For debugging or integration into scripts, you can always use raw curl.
Bash
💡 Pro Tip: Model Aliases
To save time, we recommend adding aliases to your shell configuration for frequently used models.
# Generate Shell Commands
sgpt -s "Kill process running on port 3000"
# Code Generation
sgpt --code "Write a Dockerfile for a Node.js app"
# Chat with specific model
sgpt --model claude-3-5-sonnet-20240620 "Explain quantum computing"
pip install llm
# Set API Key
llm keys set openai
# Paste your key: sk-prakasa-...
# Set Custom Endpoint (Important!)
export OPENAI_API_BASE="https://api.prakasa.me/v1"
# Pipe content to LLM
cat prompt.txt | llm -m gpt-4o
# System Prompt
llm -s "You are a cynical poet" "Describe the internet"