Skip to main content
All requests to the Routeway API must be authenticated using an API key. This key acts as your unique identifier and provides access to your account’s usage and billing.
Never expose your API key publicly. Anyone with access to your key can use your quota, rack up charges, or leak sensitive data.

Get Your API Key

1

Log In

Go to the Routeway dashboard and sign in to your account.
2

Navigate to API Keys

Once you’re logged in, open the API Keys tab from the sidebar.
3

Create a New Key

Click Create API Key, give it a name (e.g. local-dev, production), and click Confirm.
4

Copy and Store the Key

Copy your new API key and store it securely — preferably in a .env file or a secret manager like AWS Secrets Manager or HashiCorp Vault.

Set Your API Key

You must make your API key available to your application. We recommend using environment variables to avoid hardcoding the key into your source code.
  • Linux / macOS
  • Windows
export Routeway_API_KEY="your_key_here"

Authenticate in Code

  • Python
  • Node.js
  • cURL
import os
from openai import OpenAI

client = OpenAI(
  api_key=os.getenv("Routeway_API_KEY"),
  base_url="https://api.routeway.ai/v1"
)

API Key Format & Security

Routeway API keys usually begin with clsk- and are 32+ characters long.
  • Keep your keys secret.
  • Never push them to GitHub (add .env to your .gitignore).
  • Rotate keys regularly and revoke any you no longer use.

Common Errors

  • 401 - Unauthorized
  • 403 - Forbidden
{
	"error": {
		"message": "Invalid or missing API key",
		"type": "error",
		"tip": "Troubleshoot at: https://discord.gg/RjX2CpdPpd",
		"code": 401
	}
}
Fix: Make sure your Routeway_API_KEY is correctly set and passed to the client.

Best Practices

Secure Storage

Store API keys in .env files and use a secrets manager in production. Never commit them to version control.

Key Management

Regularly rotate API keys and limit their scopes to the minimum required permissions.

Monitoring

Keep an eye on your API usage.

Client-Side Security

Never expose API keys in frontend code. Always make API calls from a backend service.
I