{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Cold Email Writer — $0.01/Email, Zero LLM Markup",
    "description": "Generates personalized cold emails from enriched lead data using your own OpenAI or Anthropic key. Subject line, body, CTA, and optional follow-up sequence — $0.01/email, zero LLM markup.",
    "version": "1.0",
    "x-build-id": "I1OlqzB4jkOhthYI8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~ai-email-writer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-ai-email-writer",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/ryanclinton~ai-email-writer/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-ai-email-writer",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/ryanclinton~ai-email-writer/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-ai-email-writer",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "leads",
          "senderName",
          "senderCompany",
          "valueProposition"
        ],
        "properties": {
          "leads": {
            "title": "Leads",
            "type": "array",
            "description": "Enriched lead data. Each object can have: name, email, jobTitle, companyName, industry, services, recentNews, painPoints, linkedinUrl, website, etc. The more fields provided, the more personalized the email.",
            "default": [
              {
                "name": "Sarah Chen",
                "email": "sarah.chen@acmecorp.com",
                "jobTitle": "VP of Engineering",
                "companyName": "Acme Corp",
                "industry": "SaaS",
                "services": "Cloud infrastructure management",
                "recentNews": "Recently raised $20M Series B",
                "painPoints": "Scaling engineering team, reducing deployment friction"
              }
            ]
          },
          "llmProvider": {
            "title": "LLM Provider",
            "enum": [
              "openai",
              "anthropic"
            ],
            "type": "string",
            "description": "Which AI provider to use for email generation. Bring your own API key.",
            "default": "openai"
          },
          "openaiApiKey": {
            "title": "OpenAI API Key",
            "type": "string",
            "description": "Your OpenAI API key (sk-...). Required when LLM Provider is set to OpenAI. Your key is never logged or stored."
          },
          "anthropicApiKey": {
            "title": "Anthropic API Key",
            "type": "string",
            "description": "Your Anthropic API key (sk-ant-...). Required when LLM Provider is set to Anthropic. Your key is never logged or stored."
          },
          "llmModel": {
            "title": "LLM Model",
            "type": "string",
            "description": "Model to use for generation. OpenAI: gpt-4o-mini (cheap/fast), gpt-4o (best quality). Anthropic: claude-haiku-3-5-20241022 (fast), claude-sonnet-4-20250514 (best).",
            "default": "gpt-4o-mini"
          },
          "senderName": {
            "title": "Sender Name",
            "type": "string",
            "description": "Your full name — who the email is from.",
            "default": "Alex Johnson"
          },
          "senderCompany": {
            "title": "Sender Company",
            "type": "string",
            "description": "Your company name.",
            "default": "ApifyForge"
          },
          "senderRole": {
            "title": "Sender Role (optional)",
            "type": "string",
            "description": "Your job title or role. Shown in the email signature if provided.",
            "default": ""
          },
          "valueProposition": {
            "title": "Value Proposition",
            "type": "string",
            "description": "What you are offering. Be specific — good example: 'We build custom data pipelines that cut manual data work by 80% for SaaS companies'. This is the core of every email.",
            "default": "We build automated lead generation systems that deliver qualified prospects directly to your CRM — no manual research required."
          },
          "emailTone": {
            "title": "Email Tone",
            "enum": [
              "professional",
              "casual",
              "friendly",
              "direct"
            ],
            "type": "string",
            "description": "The tone and voice to use for the email copy.",
            "default": "professional"
          },
          "emailLength": {
            "title": "Email Length",
            "enum": [
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Target length for the email body. Short (50-80 words) is best for cold outreach. Medium (80-120 words) for more context. Long (120-180 words) for detailed pitches.",
            "default": "short"
          },
          "includeFollowUp": {
            "title": "Generate Follow-Up Email",
            "type": "boolean",
            "description": "Also generate a follow-up email for each lead (sent 3-5 days after the first). Doubles the number of LLM calls.",
            "default": false
          },
          "customInstructions": {
            "title": "Custom Instructions (optional)",
            "type": "string",
            "description": "Additional instructions for the AI. Examples: 'Always mention our case study with HubSpot', 'Use the prospect's company name in the subject line', 'Never mention competitors'.",
            "default": ""
          },
          "maxLeads": {
            "title": "Max Leads",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of leads to process. Hard cap at 500.",
            "default": 100
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}