Skip to main contentLatitude provides multiple ways to integrate with your applications. You can use our SDKs for a simpler integration experience, or interact directly with our HTTP API. You can also choose whether to use Latitude as an AI Gateway or fetch prompts and upload logs yourself.
SDKs
Latitude offers official SDKs for popular languages:
The SDKs handle authentication, request formatting, and response parsing automatically, making them the easiest way to integrate Latitude into your application.
HTTP API
You can also interact with Latitude directly using the HTTP API. This is useful if you’re using a language without an official SDK, need more control over the request/response cycle, or are building custom integrations. The API provides full access to all Latitude features including prompt execution, log management, and evaluations.
Integration Patterns
Latitude supports two main integration patterns:
Use Latitude as an AI Gateway (SDK and API support)
With this pattern, Latitude acts as a proxy between your application and the underlying AI models. When you call Latitude’s SDK or API:
- Your application sends prompt parameters to Latitude
- Latitude fetches the prompt, executes it using your configured provider, and handles all logging automatically
- Your application receives the response directly
This is the simplest integration path and provides automatic logging and trace collection. You don’t need to manage prompt execution yourself, and when you publish new prompt versions in Latitude, your application automatically uses them without any code changes.
Most applications use this pattern to leverage Latitude’s prompt management and monitoring features. To get started, check out the Publishing Prompts guide.
Fetch Prompts and Upload Logs (SDK support)
With this pattern, you manage prompt execution yourself:
- Your application fetches prompts from Latitude using the
prompts.get() method
- Your application renders the prompt using the
prompts.renderChain() method.
This method supports multi-step prompts, handles tools automatically, provides telemetry tracking, and works with both simple and complex prompts.
The onStep callback allows you to execute each step with your own infrastructure (e.g., directly calling OpenAI, Anthropic, etc.).
- Your application uploads logs back to Latitude using the
logs.push() method
This pattern gives you full control over prompt execution and lets you use your existing infrastructure and provider integrations. You still get all the benefits of Latitude’s evaluation and monitoring tools.
This is best for applications that already have their own AI provider integrations and want to add Latitude’s evaluation capabilities.
Next Steps