API Key Developer Guide

Overview

API keys provide a secure way to authenticate with the Oxy API without requiring user credentials. This guide covers everything you need to know about implementing API key authentication in your applications.

What are Oxy API Keys?

API keys are secure tokens that identify your application to the Oxy API. A unique string prefixed with oxy_

API Documentation

For a complete reference of all available API endpoints, visit our live Swagger API documentation at /apidoc. This interactive documentation allows you to:

  • Browse all available endpoints
  • View request/response schemas
  • Test API calls directly from your browser
  • Download OpenAPI specifications

The Swagger documentation is automatically updated and always reflects the current API version running on your Oxy instance.

Creating API Keys

Through the Web Interface

  1. Log into your Oxy
  2. User menu -> API Keys
  3. Click Create New API Key
  4. Provide a descriptive name for your key
  5. Set an optional expiration date
  6. Click Create API Key

Important: Copy your API key immediately after creation. For security reasons, you won’t be able to view the full key again.

Using API Keys

Authentication Header

Include your API key in the X-API-Key header with every request:

curl -H "X-API-Key: oxy_your_api_key_here" \
     https://api.oxy.com/your-endpoint

Examples

Quick Start Examples

Here are some quick examples to get you started with different programming languages:

Python

import requests
import os

# Set up your API key
api_key = os.getenv('OXY_API_KEY')
headers = {'X-API-Key': api_key}

# List your workflows
response = requests.get('https://api.oxy.com/workflows', headers=headers)
workflows = response.json()
print(f"Found {len(workflows)} workflows")

JavaScript (Node.js)

const axios = require('axios');

const client = axios.create({
  baseURL: 'https://api.oxy.com',
  headers: {
    'X-API-Key': process.env.OXY_API_KEY
  }
});

// List your workflows
client.get('/workflows')
  .then(response => {
    console.log(`Found ${response.data.length} workflows`);
  })
  .catch(error => {
    console.error('Error:', error.response.data);
  });

cURL

# List your workflows
curl -H "X-API-Key: $OXY_API_KEY" \
     https://api.oxy.com/workflows

# Create a new workflow
curl -X POST \
  -H "X-API-Key: $OXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "My Workflow", "description": "A sample workflow"}' \
  https://api.oxy.com/workflows