Latitude HTTP API Documentation
This guide explains how to use the Latitude HTTP API to interact with the Prompt Manager and run AI-powered conversations.Authentication
All API requests require authentication. Include your API key in theAuthorization
header of your HTTP requests:
Base URL
The base URL for API requests depends on your environment:https://gateway.latitude.so/api/v3
Rate Limiting
The API enforces rate limits based on your API key to ensure fair usage and prevent abuse. Limits: Rate limits are enforced based on your subscription plan. The following limits apply:-
Hobby Plan:
- 10 requests per second
-
Team Plan:
- 166 requests per second (10000 requests per minute)
-
Enterprise Plan:
- 500 requests per second (30000 requests per minute)
Retry-After
: Indicates the number of seconds to wait before making a new request.X-RateLimit-Limit
: The maximum number of requests allowed in the current period.X-RateLimit-Remaining
: The number of requests remaining in the current period.X-RateLimit-Reset
: The timestamp when the rate limit will reset.
Endpoints
1. Get a Document
Retrieve a specific prompt by its path. Endpoint:GET /projects/{projectId}/versions/{versionUuid}/documents/{path}
Path Parameters:
projectId
: Your project ID (required)versionUuid
: Version UUID (required, optional for SDK’s defaults to ‘live’)path
: Path to the document (required)
2. Get or Create a Document
Endpoint:POST /projects/{projectId}/versions/{versionUuid}/documents/get-or-create
Path Parameters:
projectId
: Your project ID (required)versionUuid
: Version UUID (required, optional for SDK’s defaults to ‘live’)
path
: Path to the document (required)prompt
: Prompt to use for the document (optional, defaults to empty)
3. Run a Document
Run a specific document (prompt) with optional parameters. Endpoint:POST /projects/{projectId}/versions/{versionUuid}/documents/run
Path Parameters:
projectId
: Your project ID (required)versionUuid
: Version UUID (required, optional for SDK’s defaults to ‘live’)
stream
: Optional boolean parameter (defaults tofalse
). When set to true, the response will be a stream of Server-Sent Events (SSE). If false, a single JSON response containing the last event is returned.
-
If
stream
istrue
: The response is a stream of Server-Sent Events (SSE). Check out the Streaming Events guide for more information about the specific events you can expect. -
If
stream
isfalse
: A single JSON response is returned with the final event (typically the chain-complete event) in the following structure:
Message follows the PromptL format.
ToolCall has the following format:
4. Chat
The previously describedPOST /projects/{projectId}/versions/{versionUuid}/documents/run
endpoint can also be used to continue a conversation. Notice all events contain a uuid
field that represents that conversation with the AI. You can use this uuid to continue the conversation.
Endpoint: POST /conversations/{conversationUuid}/chat
Path Parameters:
conversationUuid
: UUID of the conversation
- Messages follow the PromptL format. If you’re using a different method to run your prompts, you’ll need to format your messages accordingly.
stream
: Optional boolean parameter (defaults tofalse
). When set to true, the response will be a stream of Server-Sent Events (SSE). If false, a single JSON response containing the last event is returned. Check out the Streaming Events guide for more information about the specific events you can expect.
Message follows the PromptL format.
5. Annotate a Log
Add an annotation (evaluation score) to a log. Endpoint:POST /conversations/{conversationUuid}/evaluations/{evaluationUuid}/annotate
Path Parameters:
conversationUuid
: UUID of the conversation to annotateevaluationUuid
: UUID of the evaluation to use
6. Create Log Entry
Create a log entry for a document. Endpoint:POST /projects/{projectId}/versions/{versionUuid}/documents/logs
Path Parameters:
projectId
: Your project ID (required)versionUuid
: Version UUID (required, optional for SDK’s defaults to ‘live’)
- Messages follow the PromptL format. If you’re using a different method to run your prompts, you’ll need to format your messages accordingly.