Skip to main content
This guide covers production-grade patterns for using Neosantara APIs across OpenAI-compatible, Anthropic-compatible, and the Responses API. It focuses on reliability, performance, and maintainability.

Security & Key Management

Never hard-code API keys or expose them in client-side code (browsers, mobile apps). Anyone with access to your key can use your credits.

Best Practices

  • Server-Side Only: Always call Neosantara APIs from your backend. If you must use it in a frontend, create a proxy endpoint on your server.
  • Environment Variables: Use .env files and process.env (Node) or os.getenv (Python) to store keys.
  • Key Rotation: Periodically rotate your API keys via the Neosantara Dashboard.

Observability & Debugging

Every request to Neosantara returns a request_id in the response headers or body. Always log this ID alongside your application logs.

Batch & Parallel Requests

  • Python (async) using httpx to issue parallel requests
  • Node.js (Promise.all)

Retry & Fault Tolerance

  • Python (tenacity)
  • JavaScript (retry wrapper)

Caching & Idempotency

  • Simple in-memory cache

Streaming & Real-Time UX

  • Example (Python)
  • Example (Node.js)

Production Patterns & Best Practices

  • Use a dedicated API client per environment (dev/stage/prod)
  • Enable server-side token rotation and secure storage for API keys
  • Centralize error handling and retry policies
  • Log structured events for observability (request_id, model, tokens used)
  • Rate limit awareness per endpoint and tier

API Reference

Dive into endpoint specifics and parameter details.

Rate Limits

Review quotas and throttling guidance.
Last modified on June 5, 2026