Back to Home

API Documentation

Integrate CodeMorph's powerful code transformation capabilities into your applications.

Getting Started

CodeMorph's REST API allows you to integrate our AI-powered code transformation capabilities directly into your applications. Follow these steps to get started:

1. Get Your API Key

Sign up for an account and generate an API key.

2. Authentication

Include your API key in the Authorization header.

3. Make Your First Request

Start transforming code using our simple API endpoints.

Base URL

https://api.codemorph.codes
All API requests are made to this base URL
HTTPS is required for all API endpoints
TLS 1.2+ is required for secure communications

Authentication

All API requests must include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY
Never share your API key or commit it to version control.

API Endpoints

POST/v1/translate

Translate code between programming languages

API Key
100 requests/min
POST/v1/analyze

Analyze code structure and complexity

API Key
50 requests/min
POST/v1/optimize

Optimize code for performance

API Key
30 requests/min
POST/v1/batch

Process multiple files in a single request

API Key
10 requests/min

Code Examples

curl -X POST "https://api.codemorph.ai/v1/translate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "source": "python",
  "target": "javascript",
  "code": "def fibonacci(n):\n    if n <= 1:\n        return n\n    return fibonacci(n-1) + fibonacci(n-2)"
}'

Rate Limiting

Rate limits are applied on a per-API key basis. The following headers are included in all API responses:

X-RateLimit-Limit

The maximum number of requests allowed per time window

X-RateLimit-Remaining

The number of requests remaining in the current time window

X-RateLimit-Reset

The time when the current rate limit window resets

Need Help?

Our developer support team is here to help you integrate CodeMorph into your applications.