Configure and use the SDK
This guide bridges the gap between installing the SDK and building an integration. It covers authentication, a health check, and submitting a first job.
Prerequisites
- The Vantage SDK installed
- An API key (see Generate and use API keys)
Configure authentication
The SDK supports three authentication methods. Use whichever fits your environment.
Environment variable (recommended for CI/CD)
export VANTAGE_API_KEY=YOUR_API_KEY
The SDK picks it up automatically:
from vantage_sdk import VantageClient
client = VantageClient() # uses VANTAGE_API_KEY
Constructor argument
client = VantageClient(api_key="YOUR_API_KEY")
Configuration file
Create ~/.vantage/config.yaml:
default:
api_key: YOUR_API_KEY
base_url: https://api.vantage.omnivector.solutions
organization: your-org-id
The SDK loads the default profile automatically. Use the VANTAGE_PROFILE environment variable to switch profiles (for example, staging or production).
Run a health check
from vantage_sdk import VantageClient
client = VantageClient()
clusters = client.clusters.list()
print(f"Connected. Found {len(clusters)} cluster(s).")
If this prints a count, authentication and connectivity are working.
Submit a job
scripts = client.jobs.scripts.list()
script = scripts[0] # pick the first script
submission = client.jobs.submissions.create(
script_id=script.id,
cluster="your-cluster-name",
partition="compute",
name="sdk-test-job",
)
print(f"Submitted: {submission.id} — status: {submission.status}")
JavaScript/TypeScript
import { VantageClient } from '@vantage/sdk';
const client = new VantageClient({
apiKey: process.env.VANTAGE_API_KEY,
});
const clusters = await client.clusters.list();
console.log(`Connected. Found ${clusters.length} cluster(s).`);
Related
- Generate and use API keys -- create and manage keys
- SDK API reference -- full method list
- Authenticate to the REST API -- for direct HTTP access