Skip to content

5-Minute Quickstart

Get started with Cohera in just a few minutes. This guide will walk you through setting up your environment, obtaining an API key, and making your first API call.

Before you begin, make sure you have:

  • A Cohera account (sign up for free)
  • Python 3.8+ or Node.js 18+ installed
  • A terminal or command prompt
  1. Log in to your Cohera Dashboard
  2. Navigate to Settings > API Keys
  3. Click Create New Key
  4. Give your key a descriptive name (e.g., “Development”)
  5. Copy the key and store it securely
Terminal window
pip install cohera
import os
from cohera import Cohera
# Option 1: Environment variable (recommended)
os.environ["COHERA_API_KEY"] = "your-api-key"
client = Cohera()
# Option 2: Direct initialization
client = Cohera(api_key="your-api-key")

Let’s list all certificates in your organization:

from cohera import Cohera
client = Cohera()
# List all certificates
certificates = client.certificates.list()
for cert in certificates:
print(f"Certificate: {cert.name}")
print(f" Supplier: {cert.supplier.name}")
print(f" Expires: {cert.expiry_date}")
print()

Cohera’s power comes from its ontology - the relationships between objects. Let’s explore:

# Get a certificate with its relationships
cert = client.certificates.get("cert_abc123", include=["supplier", "components", "products"])
# Access related objects
print(f"Supplier: {cert.supplier.name}")
print(f"Components: {len(cert.components)}")
# Find all products affected by this certificate
for product in cert.products:
print(f" - {product.name} ({product.sku})")

Congratulations! You’ve made your first API calls to Cohera. Here’s what to explore next: