Models Endpoint
The Models endpoint returns a list of available LLM models that can be used with the Chat endpoint.
Endpoint
GET /v1/models
Headers
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | Yes | Bearer token with your API key |
Content-Type | string | Yes | Must be application/json |
Request
No request body required.
Example Request
curl -X GET https://api.cloakr.ai/v1/models \
-H "Authorization: Bearer $CLOAKR_API_KEY" \
-H "Content-Type: application/json"
JavaScript Example
import { CloakrClient } from '@cloakrai/sdk';
const client = new CloakrClient({
apiKey: process.env.CLOAKR_API_KEY
});
const models = await client.models();
console.log(models);
Python Example
from cloakrai import CloakrClient
import os
client = CloakrClient(api_key=os.getenv('CLOAKR_API_KEY'))
models = client.models()
print(models)
Response
Success Response
{
"object": "list",
"data": [
{
"id": "gpt-4o",
"object": "model",
"created": 1640995200,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-abc123",
"object": "model_permission",
"created": 1640995200,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "gpt-4o",
"parent": null,
"cloakr_metadata": {
"encryption_supported": true,
"pii_redaction_supported": true,
"cost_per_1k_tokens": 0.03,
"max_tokens": 128000,
"context_window": 128000,
"capabilities": [
"text-generation",
"code-generation",
"reasoning",
"multimodal"
],
"compliance": [
"soc2",
"gdpr",
"hipaa"
]
}
},
{
"id": "claude-3-sonnet",
"object": "model",
"created": 1640995200,
"owned_by": "anthropic",
"permission": [
{
"id": "modelperm-def456",
"object": "model_permission",
"created": 1640995200,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "claude-3-sonnet",
"parent": null,
"cloakr_metadata": {
"encryption_supported": true,
"pii_redaction_supported": true,
"cost_per_1k_tokens": 0.015,
"max_tokens": 200000,
"context_window": 200000,
"capabilities": [
"text-generation",
"code-generation",
"reasoning"
],
"compliance": [
"soc2",
"gdpr"
]
}
}
]
}
Available Models
OpenAI Models
Model ID | Description | Context Window | Cost per 1K Tokens | Capabilities |
---|---|---|---|---|
gpt-4o | GPT-4 Omni (latest) | 128K | $0.03 | Text, Code, Reasoning, Multimodal |
gpt-4o-mini | GPT-4 Omni Mini | 128K | $0.015 | Text, Code, Reasoning |
gpt-4-turbo | GPT-4 Turbo | 128K | $0.03 | Text, Code, Reasoning |
gpt-3.5-turbo | GPT-3.5 Turbo | 16K | $0.002 | Text, Code |
Anthropic Models
Model ID | Description | Context Window | Cost per 1K Tokens | Capabilities |
---|---|---|---|---|
claude-3-opus | Claude 3 Opus | 200K | $0.075 | Text, Code, Reasoning |
claude-3-sonnet | Claude 3 Sonnet | 200K | $0.015 | Text, Code, Reasoning |
claude-3-haiku | Claude 3 Haiku | 200K | $0.0025 | Text, Code |
Cloakr Internal Models
Model ID | Description | Context Window | Cost per 1K Tokens | Capabilities |
---|---|---|---|---|
cloakr-gpt-4 | Cloakr-optimized GPT-4 | 128K | $0.025 | Text, Code, Reasoning, Enhanced Security |
cloakr-claude | Cloakr-optimized Claude | 200K | $0.012 | Text, Code, Reasoning, Enhanced Security |
cloakr-enterprise | Enterprise-grade model | 256K | $0.05 | Text, Code, Reasoning, Full Compliance |
Model Capabilities
Text Generation
All models support basic text generation with configurable parameters like temperature, top_p, and max_tokens.
Code Generation
Most models excel at code generation in multiple programming languages including Python, JavaScript, Java, C++, and more.
Reasoning
Advanced models like GPT-4o and Claude-3 can perform complex reasoning tasks, mathematical calculations, and logical analysis.
Multimodal
GPT-4o supports image and audio input/output for multimodal applications.
Compliance & Security
Encryption Support
All models support end-to-end encryption with AES-256-GCM.
PII Redaction
All models support automatic PII detection and redaction.
Compliance Standards
- SOC 2 Type II: Annual security audits
- GDPR: Data residency and deletion controls
- HIPAA: Healthcare data protection (select models)
- PCI DSS: Payment card industry standards
Cost Optimization
Model Selection
- High-priority tasks: Use GPT-4o or Claude-3-Opus
- Medium-priority tasks: Use GPT-4o-mini or Claude-3-Sonnet
- Low-priority tasks: Use GPT-3.5-turbo or Claude-3-Haiku
Token Management
- Set appropriate
max_tokens
to control costs - Use streaming for long responses
- Implement caching for repeated queries
Error Responses
401 Unauthorized
{
"error": {
"type": "authentication_error",
"message": "Invalid API key",
"code": "invalid_api_key"
}
}
403 Forbidden
{
"error": {
"type": "permission_error",
"message": "Access to models endpoint denied",
"code": "access_denied"
}
}
Best Practices
- Cache model list to avoid repeated API calls
- Check capabilities before using advanced features
- Monitor costs through the dashboard
- Use appropriate models for your use case
- Implement fallbacks for model availability
Next Steps
- Chat Endpoint - Send requests to models
- Error Codes - Handle API errors
- SDK Tutorials - Advanced usage examples