Getting Started with the Vectorize API Client
Learn how to install the Vectorize client and make your first request.
The Vectorize API is currently in beta. While we strive for stability, breaking changes may occasionally be necessary.
What you can do with the Vectorize Client
The Vectorize API enables you to programmatically:
- Manage pipelines - Create, start, stop, and monitor RAG pipelines
- Handle connectors - Create and manage source, destination, and AI platform connectors
- Process data - Extract text, and retrieve documents from a pipeline
- Monitor operations - Get pipeline events and metrics
Prerequisites
Before you begin, you'll need:
- A Vectorize account
- An API access token (how to create one)
- Your organization ID (see below)
Finding your Organization ID
Your organization ID is in the Vectorize platform URL:
https://platform.vectorize.io/organization/[YOUR-ORG-ID]
For example, if your URL is:
https://platform.vectorize.io/organization/ecf3fa1d-30d0-4df1-8af6-f4852bc851cb
Your organization ID is: ecf3fa1d-30d0-4df1-8af6-f4852bc851cb
API Client Setup
- Python
- Node.js
import vectorize_client as v
import os
# Get credentials from environment variables
organization_id = os.environ.get("VECTORIZE_ORGANIZATION_ID")
api_key = os.environ.get("VECTORIZE_API_KEY")
if not organization_id or not api_key:
raise ValueError("Please set VECTORIZE_ORGANIZATION_ID and VECTORIZE_API_KEY environment variables")
# Initialize the API client
configuration = v.Configuration(
host="https://api.vectorize.io",
api_key={"ApiKeyAuth": api_key}
)
api = v.ApiClient(configuration)
print(f"✅ API client initialized for organization: {organization_id}")
const vectorize = require('@vectorize-io/vectorize-client')
// COMPLETE_EXAMPLE_PREREQUISITES:
// - env_vars: VECTORIZE_API_KEY, VECTORIZE_ORGANIZATION_ID
// - description: Initialize the Vectorize API client for making API calls
// Get credentials from environment variables
const organizationId = process.env.VECTORIZE_ORGANIZATION_ID;
const apiKey = process.env.VECTORIZE_API_KEY;
if (!organizationId || !apiKey) {
throw new Error("Please set VECTORIZE_ORGANIZATION_ID and VECTORIZE_API_KEY environment variables");
}
// Initialize the API client
const configuration = new vectorize.Configuration({
basePath: 'https://api.vectorize.io',
accessToken: apiKey
});
const apiClient = new vectorize.ApiClient(configuration);
console.log(`✅ API client initialized for organization: ${organizationId}`);
Make Your First Request
Let's list your existing pipelines to verify everything is working:
- Python
- Node.js
import vectorize_client as v
import os
# Create API interface
pipelines_api = v.PipelinesApi(apiClient)
# List all pipelines
try:
response = pipelines_api.get_pipelines(organization_id)
print(f"Found {len(response.data)} pipelines:\n")
for pipeline in response.data:
print(f" - {pipeline.name} (ID: {pipeline.id})")
print(f" Status: {pipeline.status}")
print(f" Created: {pipeline.created_at}\n")
except Exception as e:
print(f"Error: {e}")
raise
// This snippet uses async operations and should be run in an async context
(async () => {
const vectorize = require('@vectorize-io/vectorize-client')
const { PipelinesApi } = vectorize;
// Create API interface
const pipelinesApi = new PipelinesApi(apiClient);
let response;
// List all pipelines
try {
response = await pipelinesApi.getPipelines({organizationId: "your-org-id"});
console.log(`Found ${response.data.length} pipelines:\n`);
for (const pipeline of response.data) {
console.log(` - ${pipeline.name} (ID: ${pipeline.id})`);
console.log(` Status: ${pipeline.status}`);
console.log(` Created: ${pipeline.createdAt}\n`);
}
} catch (error) {
console.log(`Error: ${error.message}`);
throw error;
}
})();
Understanding the Response
A successful response will show your pipelines:
Found 2 pipelines:
- Pipeline 1 (ID: aipcbf1b-3c22-449c-a1c4-a51023225a3c)
Status: SHUTDOWN
Created: 2025-06-13T17:46:22.895Z
- Pipeline 2 (ID: aip2340c-0cc6-2372-81e0-4fdaa81c6116)
Status: HIBERNATING
Created: 2025-06-04T19:07:28.126Z
If you see an authentication error, verify:
- Your API access token is correct
- Your organization ID is correct
Complete Example
Here's all the code from this guide combined into a complete, runnable example:
- Python
- Node.js
• `VECTORIZE_API_KEY`
• `VECTORIZE_ORGANIZATION_ID`
#!/usr/bin/env python3
"""
Complete example for getting started with Vectorize - listing pipelines.
This is a hand-written example that corresponds to the test file:
api-clients/python/tests/getting_started.py
IMPORTANT: Keep this file in sync with the test file's snippets!
"""
import os
import sys
import vectorize_client as v
def get_api_config():
"""Get API configuration from environment variables."""
organization_id = os.environ.get("VECTORIZE_ORGANIZATION_ID")
api_key = os.environ.get("VECTORIZE_API_KEY")
if not organization_id or not api_key:
print("🔑 Setup required:")
print("1. Get your API key from: https://app.vectorize.io/settings")
print("2. Set environment variables:")
print(" export VECTORIZE_ORGANIZATION_ID='your-org-id'")
print(" export VECTORIZE_API_KEY='your-api-key'")
sys.exit(1)
# Always use production API
configuration = v.Configuration(
host="https://api.vectorize.io/v1",
access_token=api_key
)
return configuration, organization_id
def list_pipelines(api_client, organization_id):
"""List all pipelines in the organization."""
# Create API interface
pipelines_api = v.PipelinesApi(api_client)
# List all pipelines
try:
response = pipelines_api.get_pipelines(organization_id)
print(f"Found {len(response.data)} pipelines:\n")
for pipeline in response.data:
print(f" - {pipeline.name} (ID: {pipeline.id})")
print(f" Status: {pipeline.status}")
print(f" Created: {pipeline.created_at}\n")
return response.data
except Exception as e:
print(f"Error: {e}")
raise
def main():
"""Main function demonstrating getting started with Vectorize."""
print("=== Getting Started with Vectorize ===\n")
try:
# Get configuration
configuration, organization_id = get_api_config()
print(f"⚙️ Configuration:")
print(f" Organization ID: {organization_id}")
print(f" Host: {configuration.host}\n")
# Initialize API client with proper headers for local env
with v.ApiClient(configuration) as api_client:
# List pipelines
print("📋 Listing Pipelines:")
pipelines = list_pipelines(api_client, organization_id)
if pipelines:
print(f"✅ Successfully retrieved {len(pipelines)} pipelines!")
else:
print("📝 No pipelines found. You can create your first pipeline using the Vectorize dashboard.")
except ValueError as e:
print(f"❌ Configuration Error: {e}")
print("\n💡 Make sure to set the required environment variables:")
print(" export VECTORIZE_ORGANIZATION_ID='your-org-id'")
print(" export VECTORIZE_API_KEY='your-api-key'")
except Exception as e:
print(f"❌ Error: {e}")
sys.exit(1)
if __name__ == "__main__":
main()
• `VECTORIZE_API_KEY`
• `VECTORIZE_ORGANIZATION_ID`
#!/usr/bin/env node
/**
* Complete example for getting started with Vectorize - listing pipelines.
* This is a hand-written example that corresponds to the test file:
* api-clients/javascript/tests/getting_started.js
*
* IMPORTANT: Keep this file in sync with the test file's snippets!
*/
const vectorize = require('@vectorize-io/vectorize-client');
async function main() {
// Get credentials from environment variables
const organizationId = process.env.VECTORIZE_ORGANIZATION_ID;
const apiKey = process.env.VECTORIZE_API_KEY;
if (!organizationId || !apiKey) {
throw new Error("Please set VECTORIZE_ORGANIZATION_ID and VECTORIZE_API_KEY environment variables");
}
// Always use production API
const basePath = 'https://api.vectorize.io/v1';
// Initialize the API client
const apiClient = new vectorize.Configuration({
basePath: basePath,
accessToken: apiKey
});
console.log('🚀 Getting Started with Vectorize\n');
console.log(`Organization ID: ${organizationId}\n`);
// List all pipelines
const { PipelinesApi } = vectorize;
// Create API interface
const pipelinesApi = new PipelinesApi(apiClient);
let response;
// List all pipelines
try {
response = await pipelinesApi.getPipelines({organizationId: organizationId});
console.log(`Found ${response.data.length} pipelines:\n`);
for (const pipeline of response.data) {
console.log(` - ${pipeline.name} (ID: ${pipeline.id})`);
console.log(` Status: ${pipeline.status}`);
console.log(` Created: ${pipeline.createdAt}\n`);
}
} catch (error) {
console.log(`Error: ${error.message}`);
throw error;
}
console.log('✅ Successfully listed all pipelines');
}
// Run the example
if (require.main === module) {
main().catch(error => {
console.error('❌ Error:', error.message);
process.exit(1);
});
}
Next Steps
- Create a RAG Pipeline, perform vector search, and more
- Perform text extraction from unstructured data using Vectorize Iris
- Connect AI assistants using MCP Agents
Looking for a full working Python example? You can open it on Google Colab or download it from the GitHub repository
Looking for a full working Node.js example? You can find it on the GitHub repository
A complete reference for the Vectorize API can be found here: Vectorize API Reference. This site includes tools for interactively testing API calls as well as generating code in various programming languages.