Search Docs…

Search Docs…

Guide

Getting Started

Getting Started

The Kambrium API provides a simple, flexible interface for integrating AI-powered automation into your sales, marketing, and SaaS workflows. Using natural language prompts, you can interact with LLMs (Large Language Models) to retrieve data, generate insights, or take actions within your connected SaaS tools—without needing to build complex integrations.

This guide walks you through setting up your API key, making your first request, and understanding the response structure.


1. Authentication

To interact with the Kambrium API, you need an API key, which serves as your authentication credential.

How to Get Your API Key
  1. Log in to your Kambrium Dashboard at app.kambrium.ai.

  2. Navigate to the API Settings section.

  3. Generate or copy your API Key.

Your API key must be included in every request as part of the JSON payload.


2. Making Your First API Call

To use the Kambrium API, send a POST request to the following endpoint:

Endpoint:
POST https://agent-api.kambrium.ai/api/v1/run-agent
Request Format

Your request should include:

  • api_key: Your authentication key.

  • prompt: A natural language instruction for the AI to execute.

Example Request (Python)
import requests

# Set API Key and Prompt
api_key = "YOUR_API_KEY"

# Define the Prompt
prompt = """Create a new lead for Peter Walker, CFO at AMC Inc.
He's interested in purchasing our Quantum Analytics Suite.
Enrich company data, set next step to send proposal by Thursday.
Create a reminder for Tuesday 13th to follow up."""

# Make the API Call
response = requests.post(
    "https://agent-api.kambrium.ai/api/v1/run-agent",
    headers={"Content-Type": "application/json"},
    json={
        "api_key": api_key,
        "prompt": prompt
    }
)

# Handle Response
if response.status_code == 201:
    print("Action created successfully.")
    print("Response:", response.json())
else:
    print(f"Error: {response.status_code}")
    print("Response:", response.text)


3. Understanding the API Response

When you make a request, the Kambrium API processes the prompt and returns a structured response.

Response Fields

run_id: string A unique identifier for this request.

prompt:string The original prompt sent in the request.

result:string The outcome of the request (e.g., confirmation message).

time_needed:float Time taken (in seconds) to process the request.

tokens_usage:int Number of tokens consumed for this request.

status:string Status of the request (success or failed).

Sample response
{
    "run_id": "sfdkj2gja2ijgljsgjk9ga2gllu2gn1!",
    "prompt": "Create a new lead for Peter Walker, CFO at AMC Inc.",
    "result": "Lead created successfully in Pipedrive with follow-up reminder set.",
    "time_needed": 2.43,
    "tokens_usage": 120,
    "status": "success"
}


4. Handling Errors

If your request fails, the API will return an error message with an appropriate status code.

Common Errors & Fixes

400 Bad Request: Invalid request format: Check JSON structure

401 Unauthorized: Missing or incorrect API key: Verify API key in payload

500 Internal Server Error: Kambrium API is down or experiencing issues: Retry later or contact support