Quick start guide for developers integrating with Confidential AI Network
Before you begin, ensure you have the following requirements:
Valid Confidential AI Network account with API access enabled
Basic understanding of REST APIs and JSON
HTTPS-enabled environment for secure API communication
15-30 minutes for basic setup and first API call
Choose your preferred programming language and install the necessary dependencies:
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 .
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
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
Set up your environment variables and configuration files:
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
Initialize the SDK with your credentials:
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"
)
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'
});
Test your setup with a simple API call:
Verify your API connection is working:
# 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}")
// 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 -X GET "https://api.contractflow-pro.com/health" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json"
Learn how to authenticate your API requests:
Confidential AI Network uses OAuth 2.0 with JWT tokens:
# 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'
});
# Python client.set_token(token['access_token']) # JavaScript client.setToken(token.accessToken);
# Python new_token = client.auth.refresh_token(token['refresh_token']) # JavaScript const newToken = await client.auth.refreshToken(token.refreshToken);
Now that you're set up, explore these resources: