Skip to main content

Overview

The Noxus Client SDK uses API key-based authentication to securely connect to the Noxus AI platform. This guide covers everything you need to know about managing authentication in your applications.

API Key Basics

API keys are unique identifiers that authenticate your application with the Noxus platform. Each key is tied to a specific workspace and has defined permissions.

Workspace-Specific

Each API key belongs to a specific workspace

Permission-Based

Keys inherit permissions from your workspace role

Revocable

Keys can be revoked at any time from the dashboard

Trackable

Usage is tracked and can be monitored

Getting Your API Key

1

Access Workspace Control

Log in to your Noxus account and navigate to your workspace
2

Open Organization Settings

Go to Settings → Organization → Workspaces
3

Select Your Workspace

Choose the workspace you want to create an API key for
4

Navigate to API Keys

Click on the API Keys tab
5

Create New Key

Click Create API Key and give it a descriptive name
6

Copy and Store

Copy the generated key immediately - it won’t be shown again
API keys are only displayed once during creation. Make sure to copy and store them securely immediately.

Using API Keys

Direct Initialization

The most straightforward way to use an API key:
Store your API key in environment variables for better security:

Using python-dotenv

For local development, use python-dotenv to load environment variables:

Security Best Practices

Don’t do this:
Do this instead:
Store API keys in environment variables or secure configuration systems:
Regularly rotate your API keys for better security:
  1. Create a new API key in the dashboard
  2. Update your environment variables
  3. Test your application with the new key
  4. Revoke the old key
Use separate API keys for development, staging, and production:
Regularly check your API key usage in the Noxus dashboard to detect any unusual activity.

Configuration Management

Using Configuration Classes

Create a configuration class to manage your settings:

Using Pydantic Settings

For more advanced configuration management:

Error Handling

Handle authentication errors gracefully:

Testing Authentication

Mock Authentication for Tests

When writing tests, mock the authentication:

Integration Tests with Test Keys

For integration tests, use dedicated test API keys:

Troubleshooting

Error: 401 UnauthorizedSolutions:
  • Verify your API key is correct
  • Check if the key has been revoked
  • Ensure you’re using the right workspace key
Error: 403 ForbiddenSolutions:
  • Check your workspace role and permissions
  • Contact your workspace admin
  • Verify you’re accessing the correct workspace
Error: Connection timeouts or network errorsSolutions:
  • Check your internet connection
  • Verify the backend URL is correct
  • Check if you’re behind a corporate firewall

Next Steps

Client Configuration

Learn about advanced client configuration options

Async Operations

Understand asynchronous programming patterns

Error Handling

Master error handling and recovery strategies

Best Practices

Follow security and development best practices