API Documentation

Everything you need to integrate DevTools.ai into your application

Quick Start

Get started with DevTools.ai in under 5 minutes. Follow these simple steps to make your first API call.

1. Get your API key

Sign up and create an API key from your dashboard.

# Your API key will look like this:
dk_live_abcdef123456789...

2. Install the SDK (optional)

# Python
pip install devtools-ai

# JavaScript
npm install @devtools/ai

3. Make your first request

curl https://api.devtools.ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Authentication

DevTools.ai uses API keys for authentication. Include your API key in the Authorization header of every request.

Security Best Practice: Never expose your API key in client-side code. Always make API calls from your backend server.

Authorization: Bearer dk_live_your_api_key_here

Chat Completions

Create conversational AI experiences with our chat completions API. Compatible with OpenAI's API format.

POST /v1/chat/completions

Request Body

{
  "model": "gpt-4",
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "What is the capital of France?"}
  ],
  "temperature": 0.7,
  "max_tokens": 150,
  "stream": false
}

Response

{
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "created": 1699896916,
  "model": "gpt-4",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The capital of France is Paris."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 20,
    "completion_tokens": 8,
    "total_tokens": 28
  }
}

Models

List available AI models and their capabilities.

GET /v1/models

Available Models

Model Context Best For
gpt-4 8K Complex reasoning, code generation
gpt-3.5-turbo 4K Fast responses, general tasks
claude-2 100K Long documents, analysis

Code Analysis

Analyze code for bugs, complexity, and security issues.

POST /api/code/analyze
{
  "code": "def factorial(n):\n    return 1 if n <= 1 else n * factorial(n-1)",
  "language": "python",
  "analysis_type": "complexity"
}

Error Handling

DevTools.ai uses standard HTTP status codes and returns detailed error messages.

Code Meaning
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid API key
429 Rate Limit Exceeded
500 Server Error - Contact support

Rate Limits

Rate limits vary by plan. Monitor your usage in the dashboard.

Free

100

requests per minute

Pro

1,000

requests per minute

Enterprise

Custom

Dedicated infrastructure