Skip to main content

Get Started

This quickstart guide will help you make your first request to the Concentrate AI API. You’ll be generating AI responses in minutes.
1

Get your API key

Sign up for a Concentrate AI account and create an API key from your dashboard.
  1. Visit concentrate.ai
  2. Sign up or log in
  3. Navigate to API Keys
  4. Click Create API Key
  5. Copy your key (it starts with sk-cn)
Keep your API key secure. Never commit it to version control or share it publicly.
2

Optional: configure guardrails

Guardrails are API-key-level redaction settings.
  1. Go to Guardrails in the dashboard
  2. Select your API key
  3. Enable redaction and choose target (input, output, or both)
  4. Select entity types and save
Output redaction is applied to non-streamed responses. Streamed output ("stream": true) is not redacted.
See Guardrails & Redaction for details.
3

Make your first request

Try the API with a simple cURL request:
You should receive a response like this:
4

Usage in practice

Below are examples of usage in a variety of different programming languages:
Install the requests library:
Create a file called test.py:
Run it:

Try Different Models

Concentrate AI supports 50+ models. Try different ones to compare:

Try Streaming

Enable real-time streaming for a better user experience:

Try Tool Calling

Enable your AI to call functions and use external tools:
The model will respond with a function_call indicating it wants to use the tool. See the Tool Calling Guide for the complete multi-turn workflow.

Common Patterns

Multi-Turn Conversation

Control Parameters

Error Handling

Next Steps

Now that you’ve made your first request, explore more features:

API Reference

Complete API documentation

Streaming Responses

Real-time streaming guide

Auto Routing

Automatic model selection

Error Handling

Handle errors gracefully

Best Practices

Always set max_output_tokens to prevent unexpectedly long responses:
Never hardcode API keys. Use environment variables:
Handle transient errors with exponential backoff:
Track token usage to manage costs:

Need Help?

View Examples

See more code examples

Contact Support

Get help from our team