Getting Started

Quick start guide for developers integrating with Confidential AI Network

Developer Guide

Prerequisites

Before you begin, ensure you have the following requirements:

API Access

Valid Confidential AI Network account with API access enabled

Programming Knowledge

Basic understanding of REST APIs and JSON

Security Requirements

HTTPS-enabled environment for secure API communication

Time Estimate

15-30 minutes for basic setup and first API call

Installation

Choose your preferred programming language and install the necessary dependencies:

1
Python SDK

Install the official Python SDK using pip:

pip install contractflow-pro-sdk

Or install from source:

git clone https://github.com/contractflow-pro/sdk-python.git
cd sdk-python
pip install -e .
2
JavaScript/Node.js SDK

Install the official Node.js SDK using npm:

npm install contractflow-pro-sdk

Or install from source:

git clone https://github.com/contractflow-pro/sdk-nodejs.git
cd sdk-nodejs
npm install
3
REST API Client

For direct REST API access, use any HTTP client library:

# Python - requests
pip install requests

# Node.js - axios
npm install axios

# cURL (command line)
# Available on most systems by default

Configuration

Set up your environment variables and configuration files:

Environment Variables

Create a .env file in your project root:

# Confidential AI Network Configuration
CONTRACTFLOW_API_URL=https://api.contractflow-pro.com
CONTRACTFLOW_CLIENT_ID=your_client_id_here
CONTRACTFLOW_CLIENT_SECRET=your_client_secret_here
CONTRACTFLOW_ENVIRONMENT=production

# Optional: Custom settings
CONTRACTFLOW_TIMEOUT=30000
CONTRACTFLOW_RETRY_ATTEMPTS=3
SDK Configuration

Initialize the SDK with your credentials:

Python Example:
from contractflow_pro import ContractFlowPro

# Initialize client
client = ContractFlowPro(
    api_url="https://api.contractflow-pro.com",
    client_id="your_client_id",
    client_secret="your_client_secret"
)
JavaScript Example:
const { ContractFlowPro } = require('contractflow-pro-sdk');

// Initialize client
const client = new ContractFlowPro({
    apiUrl: 'https://api.contractflow-pro.com',
    clientId: 'your_client_id',
    clientSecret: 'your_client_secret'
});

Your First API Request

Test your setup with a simple API call:

Test Connection

Verify your API connection is working:

Python Example:
# Test API connection
try:
    response = client.health.check()
    print(f"API Status: {response['status']}")
    print(f"Version: {response['version']}")
except Exception as e:
    print(f"Connection failed: {e}")
JavaScript Example:
// Test API connection
try {
    const response = await client.health.check();
    console.log(`API Status: ${response.status}`);
    console.log(`Version: ${response.version}`);
} catch (error) {
    console.error(`Connection failed: ${error.message}`);
}
cURL Example:
curl -X GET "https://api.contractflow-pro.com/health" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Authentication

Learn how to authenticate your API requests:

OAuth 2.0 Flow

Confidential AI Network uses OAuth 2.0 with JWT tokens:

1. Get Access Token:
# Python
token = client.auth.get_token(
    username="your_username",
    password="your_password"
)

# JavaScript
const token = await client.auth.getToken({
    username: 'your_username',
    password: 'your_password'
});
2. Use Token in Requests:
# Python
client.set_token(token['access_token'])

# JavaScript
client.setToken(token.accessToken);
3. Refresh Token (when needed):
# Python
new_token = client.auth.refresh_token(token['refresh_token'])

# JavaScript
const newToken = await client.auth.refreshToken(token.refreshToken);

Next Steps

Now that you're set up, explore these resources:

API Reference

Complete API endpoint documentation

View API Docs
Code Examples

Real-world integration examples

View Examples
Integration Guide

Step-by-step integration tutorials

View Guide
Deployment Guide

Production deployment best practices

View Guide