openapi: 3.0.0
info:
  title: Article Generator API
  description: >-
    Complete API collection for AI-powered article generation.


    ## Features

    - Generate high-quality, SEO-optimized articles

    - Customizable writing style, tone, and content parameters

    - WordPress-ready HTML output

    - Automatic keyword optimization

    - Natural, human-like writing


    ## Authentication

    All requests require an API key in the `x-api-co-id` header.


    ## Base URL

    ```

    https://use.api.co.id/article-generator

    ```


    ## Pricing

    - **Cost**: 1 point per word

    - **Minimum Balance**: 1000 points required

    - **Payment**: Points are deducted after successful article generation

    - If article cost exceeds your balance, all remaining balance will be
    deducted


    ## Request Parameters

    - **Title**: Article title/topic

    - **Keywords**: Array of keywords to optimize for

    - **Allow Related Keyword**: Include related keywords in the article

    - **Language**: Article language (e.g., "Indonesia", "English")

    - **Writing Style**: Array of writing styles (e.g., ["blog-friendly",
    "academic"])

    - **Tone**: Array of tones (e.g., ["friendly", "professional"])

    - **Search Intent**: Array of search intents (e.g., ["informational",
    "commercial"])

    - **Point of View**: Array of perspectives (e.g., ["neutral",
    "first-person"])

    - **Creativity Level**: Array of creativity levels (e.g., ["balanced",
    "high"])

    - **Audience**: Target audience description

    - **Additional Prompt**: Optional additional instructions for article
    generation


    ## Response

    Returns generated article with:

    - **Meta**: Article metadata (title, keywords, language, search intent,
    audience, word count)

    - **Title**: Article title

    - **Article**: Complete article content in HTML format (WordPress-ready, no
    document tags)
  version: 1.0.0
servers:
  - url: https://use.api.co.id
tags:
  - name: Article Generation
paths:
  /article-generator/generate:
    post:
      tags:
        - Article Generation
      summary: Generate Article
      description: Generate a high-quality, SEO-optimized article based on your parameters.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - title
                - keywords
                - language
                - writing_style
                - tone
                - search_intent
                - point_of_view
                - creativity_level
                - audience
              properties:
                title:
                  type: string
                  description: Article title or topic
                  example: What is REST API
                keywords:
                  type: array
                  items:
                    type: string
                  description: Array of keywords to optimize for
                  example:
                    - REST API
                    - web development
                    - API design
                allow_related_keyword:
                  type: boolean
                  description: 'Include related keywords (default: false)'
                  default: false
                  example: true
                language:
                  type: string
                  description: Article language
                  example: Indonesia
                writing_style:
                  type: array
                  items:
                    type: string
                  description: Array of writing styles
                  example:
                    - blog-friendly
                    - informative
                tone:
                  type: array
                  items:
                    type: string
                  description: Array of tones
                  example:
                    - friendly
                    - casual
                search_intent:
                  type: array
                  items:
                    type: string
                  description: Array of search intents
                  example:
                    - informational
                point_of_view:
                  type: array
                  items:
                    type: string
                  description: Array of perspectives
                  example:
                    - neutral
                creativity_level:
                  type: array
                  items:
                    type: string
                  description: Array of creativity levels
                  example:
                    - balanced
                audience:
                  type: string
                  description: Target audience description
                  example: developers and beginners
                additional_prompt:
                  type: string
                  description: Optional additional instructions for article generation
                  example: ''
              example:
                title: What is REST API
                keywords:
                  - REST API
                  - web development
                  - API design
                allow_related_keyword: true
                language: Indonesia
                writing_style:
                  - blog-friendly
                  - informative
                tone:
                  - friendly
                  - casual
                search_intent:
                  - informational
                point_of_view:
                  - neutral
                creativity_level:
                  - balanced
                audience: developers and beginners
                additional_prompt: ''
      parameters:
        - name: x-api-co-id
          in: header
          schema:
            type: string
          description: Your API key for authentication
          example: '{{api_key}}'
      responses:
        '200':
          description: Successful response - Article generated
          content:
            application/json:
              examples:
                success:
                  summary: Success - Article Generated
                  value:
                    is_success: true
                    message: Success
                    data:
                      meta:
                        title: What is REST API
                        keywords:
                          - REST API
                          - web development
                          - API design
                          - RESTful
                          - HTTP API
                        language: Indonesia
                        search_intent: informational
                        audience: developers and beginners
                        word_count: 1245
                        additional_prompt: ''
                      title: Apa Itu REST API dan Kenapa Penting untuk Web Development
                      article: '<h1>Apa Itu REST API dan Kenapa Penting untuk Web Development</h1><p>Kalau kamu baru mulai belajar <strong>web development</strong>, pasti sering denger istilah <strong>REST API</strong>. Tapi sebenernya apa sih <strong>REST API</strong> itu? Dan kenapa penting banget untuk dipelajari?</p><h2>Pengertian REST API</h2><p><strong>REST API</strong> adalah cara untuk komunikasi antar aplikasi menggunakan protokol HTTP. REST sendiri singkatan dari Representational State Transfer, yang intinya adalah arsitektur untuk membuat <strong>web development</strong> lebih terstruktur dan mudah di-maintain.</p><h2>Karakteristik REST API</h2><p>Ada beberapa karakteristik penting dari <strong>REST API</strong> yang perlu kamu tahu...</p>'
        '400':
          description: Bad Request - Invalid request or generation failed
          content:
            application/json:
              examples:
                invalid_request:
                  summary: Error - Invalid Request
                  value:
                    is_success: false
                    message: 'Invalid request body. Please check the JSON format and required fields'
                generation_failed:
                  summary: Error - Generation Failed
                  value:
                    is_success: false
                    message: 'Failed to generate article: API service temporarily unavailable'
        '401':
          description: Unauthorized - Missing or invalid API key
          content:
            application/json:
              examples:
                missing_api_key:
                  summary: Error - Missing API Key
                  value:
                    is_success: false
                    message: User not authenticated
        '402':
          description: Payment Required - Insufficient balance
          content:
            application/json:
              examples:
                insufficient_balance:
                  summary: Error - Insufficient Balance
                  value:
                    is_success: false
                    message: 'Minimum balance of 1000 points required to use article generator. Please top up to continue.'
