The example above sends a Chat request. Complete these steps first.
1. Create an API key
Sign in to the console, open API keys, and choose Create API key. Copy the key before closing the dialog; the complete secret is shown once.
Keep the key on your server. Do not include it in browser code, mobile applications, public repositories, or URLs.
2. Set environment variables
export MANSA_API_BASE_URL="https://api.mymansa.ai"
export MANSA_API_KEY="your_mansa_api_key"The cURL, TypeScript, Python, and Go examples all read these variables.
3. Add Mansa Credits
Open Billing and add credits before sending a request. See Pricing for current rates.
4. Read the response
Read the assistant text from data.message in the example output above. Non-success responses use the format in Errors.