{"openapi":"3.1.0","info":{"title":"CampaignCURE API","description":"PreCUREによるSNS投稿文最適化。MCP: /mcp/。Bearer API keyが必要です。","version":"0.1.0"},"paths":{"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/payment/complete":{"get":{"summary":"Payment Complete","operationId":"payment_complete_payment_complete_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/payment/cancelled":{"get":{"summary":"Payment Cancelled","operationId":"payment_cancelled_payment_cancelled_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/v1/balance":{"get":{"summary":"Balance","operationId":"balance_v1_balance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/agent/v1/info":{"get":{"summary":"Agent Info","operationId":"agent_info_agent_v1_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/agent/v1/quotes":{"post":{"summary":"Agent Quote","operationId":"agent_quote_agent_v1_quotes_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptimizationRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/v1/credit-wallets":{"post":{"summary":"Credit Wallet","operationId":"credit_wallet_agent_v1_credit_wallets_post","responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/agent/v1/credits":{"get":{"summary":"Credit Balance","operationId":"credit_balance_agent_v1_credits_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/agent/v1/credit-topups":{"post":{"summary":"Credit Topup","operationId":"credit_topup_agent_v1_credit_topups_post","requestBody":{"content":{"application/json":{"schema":{"properties":{"amount_usdc":{"type":"string","maxLength":20,"title":"Amount Usdc","default":"0.10"},"idempotency_key":{"type":"string","maxLength":100,"minLength":1,"pattern":"^[a-zA-Z0-9_-]+$","title":"Idempotency Key","description":"Unique identifier for one intended credit purchase; retries with the same key do not charge again."}},"additionalProperties":false,"type":"object","required":["idempotency_key"],"title":"CreditTopupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/agent/v1/credit-topups/{topup_id}":{"get":{"summary":"Credit Topup Status","operationId":"credit_topup_status_agent_v1_credit_topups__topup_id__get","parameters":[{"name":"topup_id","in":"path","required":true,"schema":{"type":"string","title":"Topup Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/v1/credit-quotes":{"post":{"summary":"Credit Quote","operationId":"credit_quote_agent_v1_credit_quotes_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptimizationRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/v1/credit-orders":{"post":{"summary":"Credit Order","operationId":"credit_order_agent_v1_credit_orders_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/v1/orders":{"post":{"summary":"Agent Order","operationId":"agent_order_agent_v1_orders_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/v1/orders/{order_id}":{"get":{"summary":"Agent Status","operationId":"agent_status_agent_v1_orders__order_id__get","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/v1/orders/{order_id}/result":{"get":{"summary":"Agent Result","operationId":"agent_result_agent_v1_orders__order_id__result_get","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/balance/transactions":{"get":{"summary":"Transactions","operationId":"transactions_v1_balance_transactions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/topups":{"post":{"summary":"Topup","operationId":"topup_v1_topups_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopupRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/topups/{topup_id}":{"get":{"summary":"Topup Status","operationId":"topup_status_v1_topups__topup_id__get","parameters":[{"name":"topup_id","in":"path","required":true,"schema":{"type":"string","title":"Topup Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/models":{"get":{"summary":"Models","operationId":"models_v1_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/quotes":{"post":{"summary":"Quote","operationId":"quote_v1_quotes_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptimizationRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orders":{"post":{"summary":"Order","operationId":"order_v1_orders_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orders/{order_id}":{"get":{"summary":"Status","operationId":"status_v1_orders__order_id__get","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orders/{order_id}/result":{"get":{"summary":"Result","operationId":"result_v1_orders__order_id__result_get","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/metrics":{"get":{"summary":"Metrics","operationId":"metrics_v1_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/webhooks/stripe":{"post":{"summary":"Webhook","operationId":"webhook_webhooks_stripe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"FixedInformation":{"properties":{"product":{"type":"string","maxLength":3000,"minLength":1,"title":"Product"},"brand":{"type":"string","maxLength":3000,"minLength":1,"title":"Brand","default":"ブランド未指定"},"offer":{"type":"string","maxLength":3000,"minLength":1,"title":"Offer","default":"特典は未指定"},"period":{"type":"string","maxLength":3000,"minLength":1,"title":"Period","default":"期間は未指定"},"eligibility":{"type":"string","maxLength":3000,"minLength":1,"title":"Eligibility","default":"参加条件は未指定"},"required_terms":{"items":{"type":"string","maxLength":3000,"minLength":1},"type":"array","maxItems":20,"title":"Required Terms"},"required_hashtags":{"items":{"type":"string","maxLength":3000,"minLength":1},"type":"array","maxItems":10,"title":"Required Hashtags"},"forbidden_claims":{"items":{"type":"string","maxLength":3000,"minLength":1},"type":"array","maxItems":30,"title":"Forbidden Claims"}},"additionalProperties":false,"type":"object","required":["product"],"title":"FixedInformation"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"OptimizationRequest":{"properties":{"keywords":{"items":{"type":"string","maxLength":100,"minLength":1},"type":"array","maxItems":15,"title":"Keywords"},"fixed_information":{"anyOf":[{"$ref":"#/components/schemas/FixedInformation"},{"type":"null"}]},"original_post":{"anyOf":[{"type":"string","maxLength":3000,"minLength":1},{"type":"null"}],"title":"Original Post","description":"固定情報を含めない、最適化対象の呼びかけ文"},"personas":{"items":{"$ref":"#/components/schemas/PersonaInput"},"type":"array","maxItems":8,"minItems":1,"title":"Personas"},"model":{"type":"string","maxLength":150,"minLength":1,"title":"Model","default":"recommended"},"models":{"$ref":"#/components/schemas/RoleModels"},"plan":{"type":"string","enum":["light","standard","advanced"],"title":"Plan","default":"light"},"search":{"$ref":"#/components/schemas/SearchOptions"},"generate_ugc":{"type":"boolean","title":"Generate Ugc","default":false},"ugc_count":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Ugc Count","description":"納品する合成UGC数。指定時はgenerate_ugcより優先"},"max_model_calls":{"type":"integer","maximum":2000.0,"minimum":1.0,"title":"Max Model Calls","default":2000},"max_price_jpy":{"type":"integer","maximum":1000000.0,"minimum":1.0,"title":"Max Price Jpy","default":10000},"max_model_cost_usd":{"type":"number","maximum":30.0,"minimum":0.01,"title":"Max Model Cost Usd","default":1},"seed":{"type":"integer","maximum":2147483647.0,"minimum":0.0,"title":"Seed","default":42},"discovery_source":{"type":"string","enum":["direct","mcp_registry","glama","adcp","chatgpt","other"],"title":"Discovery Source","default":"direct"}},"additionalProperties":false,"type":"object","required":["personas"],"title":"OptimizationRequest"},"OrderRequest":{"properties":{"quote_id":{"type":"string","pattern":"^q_[a-f0-9]{32}$","title":"Quote Id"},"idempotency_key":{"type":"string","maxLength":120,"minLength":8,"title":"Idempotency Key"}},"additionalProperties":false,"type":"object","required":["quote_id","idempotency_key"],"title":"OrderRequest"},"PersonaInput":{"properties":{"description":{"anyOf":[{"type":"string","maxLength":3000,"minLength":1},{"type":"null"}],"title":"Description","description":"自由記述の補足。従来の入力形式も利用可能"},"age":{"anyOf":[{"type":"integer","maximum":120.0,"minimum":0.0},{"type":"null"}],"title":"Age"},"age_range":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Age Range"},"gender":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Gender"},"occupation":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Occupation"},"hobbies":{"items":{"type":"string","maxLength":100,"minLength":1},"type":"array","maxItems":20,"title":"Hobbies"},"keywords":{"items":{"type":"string","maxLength":100,"minLength":1},"type":"array","maxItems":20,"title":"Keywords"}},"additionalProperties":false,"type":"object","title":"PersonaInput"},"RoleModels":{"properties":{"optimization":{"anyOf":[{"type":"string","maxLength":150,"minLength":1},{"type":"null"}],"title":"Optimization"},"simulation":{"anyOf":[{"type":"string","maxLength":150,"minLength":1},{"type":"null"}],"title":"Simulation"},"evaluation":{"anyOf":[{"type":"string","maxLength":150,"minLength":1},{"type":"null"}],"title":"Evaluation"}},"additionalProperties":false,"type":"object","title":"RoleModels"},"SearchOptions":{"properties":{"method":{"anyOf":[{"type":"string","enum":["fixed_cps","prefpo_cps"]},{"type":"null"}],"title":"Method"},"iterations":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":1.0},{"type":"null"}],"title":"Iterations"},"samples_per_persona":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":1.0},{"type":"null"}],"title":"Samples Per Persona"},"independent_evaluation":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Independent Evaluation"},"confirmation_samples_per_persona":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":1.0},{"type":"null"}],"title":"Confirmation Samples Per Persona"}},"additionalProperties":false,"type":"object","title":"SearchOptions"},"TopupRequest":{"properties":{"amount_jpy":{"type":"integer","maximum":100000.0,"minimum":50.0,"title":"Amount Jpy","default":1000},"idempotency_key":{"type":"string","maxLength":120,"minLength":8,"title":"Idempotency Key"}},"additionalProperties":false,"type":"object","required":["idempotency_key"],"title":"TopupRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}