{"openapi":"3.1.0","info":{"title":"FoxStoria Agent Story API","version":"1.0.0","description":"Create agent-owned story generation jobs, poll job state, and receive a public FoxStoria share URL when the story is complete."},"servers":[{"url":"https://foxstoria.com/v1"}],"components":{"securitySchemes":{"AgentApiKey":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"AgentStoryCreateRequest":{"type":"object","required":["about"],"properties":{"about":{"type":"string","maxLength":2000},"lang":{"type":"string","default":"en"},"storyGenreId":{"type":"string"},"storyFormatId":{"type":"string"},"narratorId":{"type":"string"},"storyStyle":{"type":"string"},"imageStyle":{"type":"string"},"imageAspectRatio":{"type":"string"},"generateImages":{"type":"boolean"},"generateNarration":{"type":"boolean"},"generateSfx":{"type":"boolean"},"generateBackgroundMusic":{"type":"boolean"},"characters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"gender":{"type":"string"},"id":{"type":"string"}}}}}},"AgentStoryJob":{"type":"object","required":["jobId","storyId","status","createdAt"],"properties":{"jobId":{"type":"string"},"storyId":{"type":"string"},"status":{"type":"string","enum":["PROCESSING","COMPLETED","ERRORED","VIOLATED","PENDING_DRAFT_REVIEW","DRAFT_REVIEW_APPROVED","DRAFT_REVISION_REQUESTED","REVIEW_DECLINED","UNKNOWN"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"error":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"shareUrl":{"type":"string","format":"uri"}}},"PublicSharedStory":{"type":"object","required":["id","title"],"properties":{"id":{"type":"string"},"latestVersion":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"thumbnail":{"type":"string","format":"uri"},"isPremium":{"type":"boolean"}}},"PublicSharedStoryResponse":{"type":"object","required":["story"],"properties":{"story":{"$ref":"#/components/schemas/PublicSharedStory"},"shareUrl":{"type":"string","format":"uri"}}}}},"security":[{"AgentApiKey":[]}],"paths":{"/agent/stories":{"post":{"operationId":"createAgentStory","summary":"Create a story generation job","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentStoryCreateRequest"}}}},"responses":{"201":{"description":"Story job accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentStoryJob"}}}}}}},"/agent/stories/{storyId}":{"get":{"operationId":"getAgentStory","summary":"Get a story job by id","parameters":[{"in":"path","name":"storyId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Story job status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentStoryJob"}}}},"404":{"description":"Story job not found"}}}},"/public/story-shares/{shareToken}":{"get":{"operationId":"getPublicSharedStory","summary":"Get the public metadata for a shared story","security":[],"parameters":[{"in":"path","name":"shareToken","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Shared story metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicSharedStoryResponse"}}}},"404":{"description":"Shared story not found"}}}}}}