API Overview

The INK API provides programmatic access to all INK features. Build powerful AI-driven applications with our RESTful endpoints.

Base URL

All API requests should be made to:

https://api.inkai.ph/v1

Request Format

All requests must include:

  • Authorization header with your API key
  • Content-Type: application/json for POST/PUT requests

Response Format

All responses follow a consistent structure:

{
  "success": true,
  "data": {
    // Response data
  }
}

Error responses include an error object:

{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable message"
  }
}

Endpoints

Content Generation

| Method | Endpoint | Description | |--------|----------|-------------| | POST | /generate | Generate content from a prompt | | POST | /refine | Refine existing content | | GET | /templates | List available templates |

Projects

| Method | Endpoint | Description | |--------|----------|-------------| | GET | /projects | List all projects | | POST | /projects | Create a new project | | GET | /projects/:id | Get project details | | DELETE | /projects/:id | Delete a project |

Exports

| Method | Endpoint | Description | |--------|----------|-------------| | POST | /exports | Create an export | | GET | /exports/:id | Get export status |

Code Examples

Generate Content

const response = await fetch('https://api.inkai.ph/v1/generate', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    prompt: 'Write a market analysis for sustainable fashion',
    template: 'market-analysis',
    options: {
      tone: 'professional',
      length: 'detailed'
    }
  })
})

const data = await response.json()
console.log(data.data.content)

Next Steps