globalMOO Documentation
  • globalMOO API Documentation
  • core
    • Authentication
    • Core Concepts
    • Getting Started with globalMOO
    • Error Handling
    • Event Handling
    • SDK Initialization
    • Debugging & Logging
  • schemas
    • Account Schema
    • Model Schema
    • Project Schema
    • Trial Schema
    • Objective Schema
    • Result Schema
    • Inverse Schema
  • quickstart
    • Your First Optimization with globalMOO
  • endpoints
    • accounts
      • Account Endpoints
      • Register Account
    • inverse
      • Inverse Optimization Endpoints
      • Initialize Inverse Optimization
      • Load Inverse Output
      • Suggest Inverse Step
    • models
      • Create Model
      • Model Endpoints
      • List Models
    • objectives
      • Objective Endpoints
      • Load Objectives
    • outputs
      • Output Endpoints
      • Load Output Cases
      • Load Developed Outputs
    • projects
      • Create Project
      • Project Endpoints
    • trials
      • Trial Endpoints
      • Read Trial
Powered by GitBook
On this page
  • API Keys
  • SDK Authentication
  • Environment Variables
  • TLS Validation
  • Security Best Practices
  1. core

Authentication

The globalMOO API uses API keys for authentication. To access the API, you'll need to include your API key in the authorization header of each request.

API Keys

API keys should be included in the Authorization header of each request:

Authorization: Bearer your-api-key-here

SDK Authentication

from globalmoo.client import Client
from globalmoo.credentials import Credentials

# Method 1: Using environment variables
client = Client()

# Method 2: Direct credentials
credentials = Credentials(
    api_key="your-api-key",
    base_uri="https://app.globalmoo.com/api/",
    validate_tls=True  # Defaults to True, required for globalmoo.ai domains
)
client = Client(credentials=credentials)
const { Client } = require('globalmoo');

// Method 1: Using environment variables
const client = new Client();

// Method 2: Direct configuration
const client = new Client({
    apiKey: "your-api-key",
    baseUri: "https://app.globalmoo.com/api/",
    validateTls: true  // Defaults to true, required for globalmoo.ai domains
});
use GlobalMoo\Client;
use GlobalMoo\Credentials;

// Method 1: Using environment variables
$client = new Client();

// Method 2: Direct credentials
$credentials = new Credentials(
    apiKey: "your-api-key",
    baseUri: "https://app.globalmoo.com/api/",
    validateTls: true  // Defaults to true, required for globalmoo.ai domains
);
$client = new Client($credentials);

Environment Variables

The SDKs support loading credentials from environment variables:

  • GMOO_API_KEY: Your API key

  • GMOO_API_URI: API base URI (defaults to https://app.globalmoo.com/api/)

TLS Validation

The SDKs validate TLS certificates by default for security. This is required when using official globalmoo.ai domains but can be disabled for testing:

# For local testing with self-signed certificates
credentials = Credentials(
    api_key="your-api-key",
    base_uri="https://localhost:8443/",
    validate_tls=False
)
// For local testing with self-signed certificates
const client = new Client({
    apiKey: "your-api-key",
    baseUri: "https://localhost:8443/",
    validateTls: false
});
// For local testing with self-signed certificates
$credentials = new Credentials(
    apiKey: "your-api-key",
    baseUri: "https://localhost:8443/",
    validateTls: false
);

Security Best Practices

  1. Keep your API key secure and never share it

  2. Use environment variables to store API keys

  3. Rotate API keys periodically

  4. Use different API keys for development and production

PreviouscoreNextCore Concepts

Last updated 3 months ago