// Set debug flag in constructor
$client = new Client(debug: true);
// Configure logging
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
$logger = new Logger('globalmoo');
$logger->pushHandler(new StreamHandler('php://stdout', Logger::DEBUG));
const client = new Client({
debug: true,
logger: console
});
HTTP Client Configuration
The SDKs use different HTTP clients:
Python: httpx
PHP: Symfony HttpClient
Node.js: node-fetch
Custom configuration options:
Option
Default
Description
timeout
30.0
Request timeout in seconds
retries
3
Number of retry attempts
backoff
exponential
Retry backoff strategy
headers
{}
Custom HTTP headers
Best Practices
Use environment variables for credentials
Enable debug mode during development
Configure appropriate timeouts
Handle client cleanup (Python/PHP)
Set custom headers when needed
Use typed inputs where available
Configure logging appropriately
Client Lifecycle
# Python example
with Client() as client:
# Client automatically closes
result = client.create_model(...)
# Manual cleanup
client = Client()
try:
result = client.create_model(...)
finally:
client.http_client.close()