API Reference
Welcome to the Kloddy API. Our REST API is designed to be predictable, resource-oriented, and uses standard HTTP response codes and authentication.
Base URLs
The Kloddy API is served over HTTPS to ensure data privacy and security.
| Environment | Base URL |
|---|---|
| Production | https://api.kloddy.com |
| Development | http://localhost:3001 |
Authentication
Kloddy uses JSON Web Tokens (JWT) for authentication. All API requests must include your token in the Authorization HTTP header.
1. Get an Access Token
Exchange your applicationId and secretKey for a JWT.
Body Parameters
applicationId(string, required)secretKey(string, required)
2. CLI Polling
Used by the Kloddy CLI for long-running OAuth flows.
Query Parameters
code(string, required): The session hash.
Core Endpoints
User & Identity
Returns the identity profile for the current authenticated session.
Organizations
Lists all organizations the current user has access to.
Prompts & Execution
List Prompts
Query Parameters
page(number)pageSize(number)name(string): Filter by name.org_id(uuid): Filter by organization.
Execute Prompt (Play)
Run a prompt version through a model with specific variables.
Body Parameters
variables(object): Key-value pairs for prompt injection.model(string): The AI model to use (e.g.,gpt-4o).version(string): The specific prompt version.resolve(boolean): Whether to resolve@mentions.
curl -X POST https://api.kloddy.com/api/prompt/hello-world \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"variables": {"user": "Alice"}}'
Evaluations
Compare multiple models or versions using a judge-based evaluation.
Request Body
{
"name": "prompt-name",
"models": ["gpt-4o", "claude-3-5-sonnet"],
"judge": "gpt-4o",
"version": ["v1", "v2"],
"variables": { "input": "test data" }
}