{"openapi":"3.1.0","info":{"title":"Ink API","version":"1.0.0","description":"Write and rewrite with Ink. API keys require a paid plan after trial, except for Unlimited accounts. A current terms receipt is required, except when clearing feedback."},"servers":[{"url":"https://ink.ego.ist"}],"paths":{"/api/v1/rewrites":{"post":{"operationId":"create-rewrite","summary":"Create a rewrite","security":[{"Bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RewriteRequest"}}}},"description":"Rewrite up to 20,000 words or use direct mode for up to 4,000 words. Maximum 200,000 characters. Reserve max(input_words, 100) words. All REST calls share 60 requests per minute per key. New jobs share 10 per minute per user. Unknown fields are rejected. Unicode, word counts, lock occurrences and cross-field rules are checked by the service.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"},"description":"Reuse a UUID for the same request. A changed request with the same UUID returns idempotency_conflict."}],"responses":{"200":{"description":"Finished job. Review warnings and needs_review before using output.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RewriteJob"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"202":{"description":"Pending job. Poll Location until terminal.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingJob"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"400":{"description":"Missing Idempotency-Key or invalid JSON. invalid_input also uses 400 for lock edits and target word budget errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"401":{"description":"unauthorized: A valid API key is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"402":{"description":"paid_plan_required: API keys require a paid subscription. Trials do not qualify.\n\nsetup_required: Choose an Ink plan to rewrite.\n\nquota_exceeded: This rewrite exceeds your remaining word allowance.\n\npayment_past_due: Your last payment failed. Update your card in Billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"403":{"description":"terms_required: Accept Ink terms to continue.\n\nforbidden_origin: This request must come from Ink.\n\npermission_required: Passport permission is required to use this voice. Review access or delete the adapter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"404":{"description":"not_found: Rewrite not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"405":{"description":"method_not_allowed: This method is not allowed for this endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"409":{"description":"idempotency_conflict: This Idempotency-Key was already used with different text or settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"413":{"description":"text_too_long: This text exceeds the request limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"422":{"description":"unknown_field: Remove the unknown field.\n\ninvalid_input: Enter text and choose valid rewrite settings.\n\ninput_too_long: This text exceeds the request limit.\n\ntraining_in_progress: This voice profile is still training.\n\ninsufficient_samples: This voice profile needs approved samples and an active adapter.\n\noutput_unreliable: This draft did not rewrite reliably, so we stopped. Your words were not used. Try a shorter section.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"429":{"description":"key_cap_exceeded: This rewrite exceeds this API key's monthly word cap.\n\nrate_limited: Too many rewrite requests. Try again later.\n\ndaily_ceiling_exceeded: The daily safety limit has been reached. Try again after 00:00 UTC.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Seconds until retry, when supplied.","schema":{"type":"string"}},"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"503":{"description":"tool_unavailable: Writing from a prompt is unavailable right now.\n\nmodel_unavailable: The model is starting or unavailable. Try again shortly.\n\nmodel_rejected: The model could not process this rewrite.\n\npinned_adapter_unavailable: The model version pinned to this rewrite is unavailable. Start a new rewrite.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}}}}},"/api/v1/rewrites/{id}":{"get":{"operationId":"get-rewrite","summary":"Get a job","security":[{"Bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Current owned job, including failed jobs. After text expiry, output is absent and blocks is empty.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Missing Idempotency-Key or invalid JSON. invalid_input also uses 400 for lock edits and target word budget errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"401":{"description":"unauthorized: A valid API key is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"402":{"description":"paid_plan_required: API keys require a paid subscription. Trials do not qualify.\n\nsetup_required: Choose an Ink plan to rewrite.\n\nquota_exceeded: This rewrite exceeds your remaining word allowance.\n\npayment_past_due: Your last payment failed. Update your card in Billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"403":{"description":"terms_required: Accept Ink terms to continue.\n\nforbidden_origin: This request must come from Ink.\n\npermission_required: Passport permission is required to use this voice. Review access or delete the adapter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"404":{"description":"not_found: Rewrite not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"405":{"description":"method_not_allowed: This method is not allowed for this endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"409":{"description":"idempotency_conflict: This Idempotency-Key was already used with different text or settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"413":{"description":"text_too_long: This text exceeds the request limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"422":{"description":"unknown_field: Remove the unknown field.\n\ninvalid_input: Enter text and choose valid rewrite settings.\n\ninput_too_long: This text exceeds the request limit.\n\ntraining_in_progress: This voice profile is still training.\n\ninsufficient_samples: This voice profile needs approved samples and an active adapter.\n\noutput_unreliable: This draft did not rewrite reliably, so we stopped. Your words were not used. Try a shorter section.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"429":{"description":"key_cap_exceeded: This rewrite exceeds this API key's monthly word cap.\n\nrate_limited: Too many rewrite requests. Try again later.\n\ndaily_ceiling_exceeded: The daily safety limit has been reached. Try again after 00:00 UTC.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Seconds until retry, when supplied.","schema":{"type":"string"}},"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"503":{"description":"tool_unavailable: Writing from a prompt is unavailable right now.\n\nmodel_unavailable: The model is starting or unavailable. Try again shortly.\n\nmodel_rejected: The model could not process this rewrite.\n\npinned_adapter_unavailable: The model version pinned to this rewrite is unavailable. Start a new rewrite.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}}}},"delete":{"operationId":"cancel-rewrite","summary":"Cancel a job","security":[{"Bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Current state. Cancellation can remain pending until the worker stops. Unused words are refunded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Missing Idempotency-Key or invalid JSON. invalid_input also uses 400 for lock edits and target word budget errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"401":{"description":"unauthorized: A valid API key is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"402":{"description":"paid_plan_required: API keys require a paid subscription. Trials do not qualify.\n\nsetup_required: Choose an Ink plan to rewrite.\n\nquota_exceeded: This rewrite exceeds your remaining word allowance.\n\npayment_past_due: Your last payment failed. Update your card in Billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"403":{"description":"terms_required: Accept Ink terms to continue.\n\nforbidden_origin: This request must come from Ink.\n\npermission_required: Passport permission is required to use this voice. Review access or delete the adapter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"404":{"description":"not_found: Rewrite not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"405":{"description":"method_not_allowed: This method is not allowed for this endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"409":{"description":"idempotency_conflict: This Idempotency-Key was already used with different text or settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"413":{"description":"text_too_long: This text exceeds the request limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"422":{"description":"unknown_field: Remove the unknown field.\n\ninvalid_input: Enter text and choose valid rewrite settings.\n\ninput_too_long: This text exceeds the request limit.\n\ntraining_in_progress: This voice profile is still training.\n\ninsufficient_samples: This voice profile needs approved samples and an active adapter.\n\noutput_unreliable: This draft did not rewrite reliably, so we stopped. Your words were not used. Try a shorter section.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"429":{"description":"key_cap_exceeded: This rewrite exceeds this API key's monthly word cap.\n\nrate_limited: Too many rewrite requests. Try again later.\n\ndaily_ceiling_exceeded: The daily safety limit has been reached. Try again after 00:00 UTC.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Seconds until retry, when supplied.","schema":{"type":"string"}},"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"503":{"description":"tool_unavailable: Writing from a prompt is unavailable right now.\n\nmodel_unavailable: The model is starting or unavailable. Try again shortly.\n\nmodel_rejected: The model could not process this rewrite.\n\npinned_adapter_unavailable: The model version pinned to this rewrite is unavailable. Start a new rewrite.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}}}}},"/api/v1/rewrites/{id}/feedback":{"get":{"operationId":"get-feedback","summary":"Get feedback","security":[{"Bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Owned job feedback and credit eligibility.","content":{"application/json":{"schema":{"type":"object","required":["feedback","creditedWords","note_retention_days"],"properties":{"feedback":{"anyOf":[{"$ref":"#/components/schemas/Feedback"},{"type":"null"}]},"creditedWords":{"type":"integer","minimum":0},"note_retention_days":{"type":"integer","const":90},"eligibleForCredit":{"type":"boolean"},"creditRequiresPaidPlan":{"type":"boolean"}}}}}},"400":{"description":"Missing Idempotency-Key or invalid JSON. invalid_input also uses 400 for lock edits and target word budget errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"401":{"description":"unauthorized: A valid API key is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"402":{"description":"paid_plan_required: API keys require a paid subscription. Trials do not qualify.\n\nsetup_required: Choose an Ink plan to rewrite.\n\nquota_exceeded: This rewrite exceeds your remaining word allowance.\n\npayment_past_due: Your last payment failed. Update your card in Billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"403":{"description":"terms_required: Accept Ink terms to continue.\n\nforbidden_origin: This request must come from Ink.\n\npermission_required: Passport permission is required to use this voice. Review access or delete the adapter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"404":{"description":"not_found: Rewrite not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"405":{"description":"method_not_allowed: This method is not allowed for this endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"409":{"description":"idempotency_conflict: This Idempotency-Key was already used with different text or settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"413":{"description":"text_too_long: This text exceeds the request limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"422":{"description":"unknown_field: Remove the unknown field.\n\ninvalid_input: Enter text and choose valid rewrite settings.\n\ninput_too_long: This text exceeds the request limit.\n\ntraining_in_progress: This voice profile is still training.\n\ninsufficient_samples: This voice profile needs approved samples and an active adapter.\n\noutput_unreliable: This draft did not rewrite reliably, so we stopped. Your words were not used. Try a shorter section.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"429":{"description":"key_cap_exceeded: This rewrite exceeds this API key's monthly word cap.\n\nrate_limited: Too many rewrite requests. Try again later.\n\ndaily_ceiling_exceeded: The daily safety limit has been reached. Try again after 00:00 UTC.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Seconds until retry, when supplied.","schema":{"type":"string"}},"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"503":{"description":"tool_unavailable: Writing from a prompt is unavailable right now.\n\nmodel_unavailable: The model is starting or unavailable. Try again shortly.\n\nmodel_rejected: The model could not process this rewrite.\n\npinned_adapter_unavailable: The model version pinned to this rewrite is unavailable. Start a new rewrite.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}}}},"post":{"operationId":"save-feedback","summary":"Save or clear feedback","security":[{"Bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackRequest"}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"description":"Only completed, completed_with_warnings or needs_review jobs accept feedback. Sending feedback shares original text, output and note with Ink to improve and train its models. Text and notes expire after 90 days. Editing does not restart text retention. Clear with {\"rating\":null}, including without current terms. Only down accepts reasons. Notes allow at most 500 Unicode characters. Bodies allow at most 8,192 bytes. Feedback writes share 30 per minute per user.","responses":{"200":{"description":"Saved or cleared feedback.","content":{"application/json":{"schema":{"type":"object","required":["feedback","creditedWords","note_retention_days"],"properties":{"feedback":{"anyOf":[{"$ref":"#/components/schemas/Feedback"},{"type":"null"}]},"creditedWords":{"type":"integer","minimum":0},"note_retention_days":{"type":"integer","const":90},"eligibleForCredit":{"type":"boolean"},"creditRequiresPaidPlan":{"type":"boolean"}}}}}},"400":{"description":"Missing Idempotency-Key or invalid JSON. invalid_input also uses 400 for lock edits and target word budget errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"401":{"description":"unauthorized: A valid API key is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"402":{"description":"paid_plan_required: API keys require a paid subscription. Trials do not qualify.\n\nsetup_required: Choose an Ink plan to rewrite.\n\nquota_exceeded: This rewrite exceeds your remaining word allowance.\n\npayment_past_due: Your last payment failed. Update your card in Billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"403":{"description":"terms_required: Accept Ink terms to continue.\n\nforbidden_origin: This request must come from Ink.\n\npermission_required: Passport permission is required to use this voice. Review access or delete the adapter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"404":{"description":"not_found: Rewrite not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"405":{"description":"method_not_allowed: This method is not allowed for this endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"409":{"description":"idempotency_conflict: This Idempotency-Key was already used with different text or settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"413":{"description":"text_too_long: This text exceeds the request limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"422":{"description":"unknown_field: Remove the unknown field.\n\ninvalid_input: Enter text and choose valid rewrite settings.\n\ninput_too_long: This text exceeds the request limit.\n\ntraining_in_progress: This voice profile is still training.\n\ninsufficient_samples: This voice profile needs approved samples and an active adapter.\n\noutput_unreliable: This draft did not rewrite reliably, so we stopped. Your words were not used. Try a shorter section.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"429":{"description":"key_cap_exceeded: This rewrite exceeds this API key's monthly word cap.\n\nrate_limited: Too many rewrite requests. Try again later.\n\ndaily_ceiling_exceeded: The daily safety limit has been reached. Try again after 00:00 UTC.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Seconds until retry, when supplied.","schema":{"type":"string"}},"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"503":{"description":"tool_unavailable: Writing from a prompt is unavailable right now.\n\nmodel_unavailable: The model is starting or unavailable. Try again shortly.\n\nmodel_rejected: The model could not process this rewrite.\n\npinned_adapter_unavailable: The model version pinned to this rewrite is unavailable. Start a new rewrite.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}}}}},"/api/v1/writes":{"post":{"operationId":"create-write","summary":"Write from a prompt","security":[{"Bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteRequest"}}}},"description":"Send all instructions in prompt, up to 6,000 words and 200,000 characters. Ink sends one user message without a system prompt. Reserve up to 4,000 output words; admission requires at least min(300, 4,000) available words and the API minimum of 100. Charge actual output words and refund the remainder. Failed or cancelled jobs refund the full reservation. Poll, cancel and give feedback through rewrite job URLs.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"},"description":"Reuse a UUID for the same request. A changed request with the same UUID returns idempotency_conflict."}],"responses":{"200":{"description":"Finished job. Review warnings and needs_review before using output.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteJob"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"202":{"description":"Pending job. Poll Location until terminal.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingJob"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"400":{"description":"Missing Idempotency-Key or invalid JSON. invalid_input also uses 400 for lock edits and target word budget errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"401":{"description":"unauthorized: A valid API key is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"402":{"description":"paid_plan_required: API keys require a paid subscription. Trials do not qualify.\n\nsetup_required: Choose an Ink plan to rewrite.\n\nquota_exceeded: This rewrite exceeds your remaining word allowance.\n\npayment_past_due: Your last payment failed. Update your card in Billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"403":{"description":"terms_required: Accept Ink terms to continue.\n\nforbidden_origin: This request must come from Ink.\n\npermission_required: Passport permission is required to use this voice. Review access or delete the adapter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"404":{"description":"not_found: Rewrite not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"405":{"description":"method_not_allowed: This method is not allowed for this endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"409":{"description":"idempotency_conflict: This Idempotency-Key was already used with different text or settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"413":{"description":"text_too_long: This text exceeds the request limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"422":{"description":"unknown_field: Remove the unknown field.\n\ninvalid_input: Enter text and choose valid rewrite settings.\n\ninput_too_long: This text exceeds the request limit.\n\ntraining_in_progress: This voice profile is still training.\n\ninsufficient_samples: This voice profile needs approved samples and an active adapter.\n\noutput_unreliable: This draft did not rewrite reliably, so we stopped. Your words were not used. Try a shorter section.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"429":{"description":"key_cap_exceeded: This rewrite exceeds this API key's monthly word cap.\n\nrate_limited: Too many rewrite requests. Try again later.\n\ndaily_ceiling_exceeded: The daily safety limit has been reached. Try again after 00:00 UTC.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Seconds until retry, when supplied.","schema":{"type":"string"}},"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}},"503":{"description":"tool_unavailable: Writing from a prompt is unavailable right now.\n\nmodel_unavailable: The model is starting or unavailable. Try again shortly.\n\nmodel_rejected: The model could not process this rewrite.\n\npinned_adapter_unavailable: The model version pinned to this rewrite is unavailable. Start a new rewrite.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Location":{"description":"Poll this job URL with the same Bearer key.","schema":{"type":"string"}}}}}}},"/api/agent/signup":{"post":{"operationId":"agent-signup","summary":"Create a claim link","security":[],"description":"With the person's permission, create a signup handoff. No tokens or email are issued. The person signs in with the supplied email, accepts terms and enters a card. Claims expire after 24 hours with 5 failed attempts. Signup limits: 20/IP/hour and 3/email/hour. Email is trimmed and lowercased; locally blocked temporary domains are rejected. Body limit: 4,096 bytes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}}},"responses":{"201":{"description":"Claim handoff. Existing and new emails receive the same shape.","content":{"application/json":{"schema":{"type":"object","required":["claim_code","claim_url","expires_at","next_steps"],"properties":{"claim_code":{"type":"string"},"claim_url":{"type":"string","format":"uri"},"expires_at":{"type":"string","format":"date-time"},"next_steps":{"type":"string"}}}}}},"400":{"description":"Signup error. Do not infer account existence or retry signup in a loop.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"413":{"description":"Signup error. Do not infer account existence or retry signup in a loop.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"415":{"description":"Signup error. Do not infer account existence or retry signup in a loop.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"429":{"description":"Signup error. Do not infer account existence or retry signup in a loop.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}},"503":{"description":"Signup error. Do not infer account existence or retry signup in a loop.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}}},"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"bearer","description":"Ink API key from /app/api-keys."}},"schemas":{"RewriteRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"default":"rewrite","type":"string","enum":["rewrite","direct"]},"text":{"type":"string"},"settings":{"type":"object","properties":{"context":{"default":"general","type":"string","enum":["general","work","casual","academic"]},"formality":{"default":"auto","type":"string","enum":["auto","more formal","less formal"]},"strength":{"type":"string","enum":["light","balanced","strong"]},"target_words":{"type":"integer","minimum":20,"maximum":2000}},"additionalProperties":false},"locks":{"type":"array","items":{"type":"string"}},"unlocks":{"type":"array","items":{"type":"string"}},"profile":{"default":"shared","anyOf":[{"type":"string","const":"shared"},{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}]}},"required":["text"],"additionalProperties":false},"WriteRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"prompt":{"type":"string"}},"required":["prompt"],"additionalProperties":false},"FeedbackRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"rating":{"anyOf":[{"type":"string","enum":["up","down"]},{"type":"null"}]},"reasons":{"default":[],"maxItems":5,"type":"array","items":{"type":"string","enum":["Changed my meaning","Still reads as AI","Wrong tone","Dropped facts or details","Other"]}},"note":{"type":["string","null"]}},"required":["rating"],"additionalProperties":false},"SignupRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"plan":{"default":"ink","type":"string","enum":["ink","ink_pro"]},"interval":{"default":"monthly","type":"string","enum":["monthly","annual"]},"agent":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[^\\p{Cc}\\p{Cf}]+$"},"url":{"type":"string","maxLength":2048,"format":"uri"},"version":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[^\\p{Cc}\\p{Cf}]+$"}},"required":["name"],"additionalProperties":false}},"required":["email"],"additionalProperties":false},"Feedback":{"type":"object","required":["rating","reasons","note"],"properties":{"rating":{"enum":["up","down"]},"reasons":{"type":"array","items":{"type":"string"}},"note":{"type":["string","null"]}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["idempotency_key_required","invalid_json","unauthorized","paid_plan_required","setup_required","quota_exceeded","payment_past_due","terms_required","forbidden_origin","permission_required","not_found","method_not_allowed","idempotency_conflict","text_too_long","unknown_field","invalid_input","input_too_long","training_in_progress","insufficient_samples","output_unreliable","key_cap_exceeded","rate_limited","daily_ceiling_exceeded","tool_unavailable","model_unavailable","model_rejected","pinned_adapter_unavailable"]},"message":{"type":"string"},"field":{"type":"string"},"action_url":{"type":"string","format":"uri"},"hint":{"type":"string"}}}}},"PendingJob":{"type":"object","required":["id","status"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["queued","rewriting","validating"]}}},"Job":{"type":"object","required":["id","status","blocks","progress","warnings","input_words","charged_words","created_at","finished_at"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["queued","rewriting","validating","completed","completed_with_warnings","needs_review","failed","cancelled"]},"mode":{"enum":["rewrite","direct","write"]},"output":{"type":"string"},"change_summary":{"type":"string"},"input_words":{"type":"integer","minimum":0},"charged_words":{"type":"integer","minimum":0},"refunded_words":{"type":"integer","minimum":0},"created_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"warnings":{"type":"array","description":"Deliver output with its warnings. On details_added, show the warning listing added details: \"Check added details before use: ...\". On first_person_added, show the warning listing added first-person words: \"Added first-person wording: ...\" or, when the list is absent, \"Added first-person wording. Check the rewrite.\". Do not retry details_added, first_person_added or sections_kept automatically. For the new rewrite policy, light and balanced deliver persistent first-person additions with completed_with_warnings; missing contains unique lowercase words with straight apostrophes. Strong keeps the affected source section and refunds it through sections_kept. These checks do not apply to older saved policies, REST direct mode or writing from a prompt. See /docs/api#first-person-wording for source context rules and the quotation limit. Rewrite meaning checks run silently with OpenAI when configured and may use one shared retry per section. Light and balanced deliver persistent meaning problems silently. Strong keeps and refunds a section through sections_kept only for a persistent critical added claim, changed fact or speaker problem. Material findings are delivered silently. Older saved policies keep their behavior. Unavailable checks fail open.","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"missing":{"type":"array","items":{"type":"string"}},"missing_count":{"type":"integer","minimum":0}}}},"blocks":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0},"text":{"type":"string"}}}},"progress":{"type":"object","properties":{"phase":{"enum":["queued","starting_model","writing","rewriting","validating",null]},"blocks_done":{"type":"integer","minimum":0},"blocks_total":{"type":"integer","minimum":0}}},"fact_report":{"type":"object","properties":{"total":{"type":"integer","minimum":0},"kept":{"type":"integer","minimum":0},"groups":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"total":{"type":"integer","minimum":0},"kept":{"type":"integer","minimum":0}}}},"changed":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"type":{"type":"string"}}}}}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"RewriteJob":{"type":"object","required":["id","status","blocks","progress","warnings","input_words","charged_words","created_at","finished_at"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["queued","rewriting","validating","completed","completed_with_warnings","needs_review","failed","cancelled"]},"mode":{"enum":["rewrite","direct"]},"output":{"type":"string"},"change_summary":{"type":"string"},"input_words":{"type":"integer","minimum":0},"charged_words":{"type":"integer","minimum":0},"refunded_words":{"type":"integer","minimum":0},"created_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"warnings":{"type":"array","description":"Deliver output with its warnings. On details_added, show the warning listing added details: \"Check added details before use: ...\". On first_person_added, show the warning listing added first-person words: \"Added first-person wording: ...\" or, when the list is absent, \"Added first-person wording. Check the rewrite.\". Do not retry details_added, first_person_added or sections_kept automatically. For the new rewrite policy, light and balanced deliver persistent first-person additions with completed_with_warnings; missing contains unique lowercase words with straight apostrophes. Strong keeps the affected source section and refunds it through sections_kept. These checks do not apply to older saved policies, REST direct mode or writing from a prompt. See /docs/api#first-person-wording for source context rules and the quotation limit. Rewrite meaning checks run silently with OpenAI when configured and may use one shared retry per section. Light and balanced deliver persistent meaning problems silently. Strong keeps and refunds a section through sections_kept only for a persistent critical added claim, changed fact or speaker problem. Material findings are delivered silently. Older saved policies keep their behavior. Unavailable checks fail open.","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"missing":{"type":"array","items":{"type":"string"}},"missing_count":{"type":"integer","minimum":0}}}},"blocks":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0},"text":{"type":"string"}}}},"progress":{"type":"object","properties":{"phase":{"enum":["queued","starting_model","writing","rewriting","validating",null]},"blocks_done":{"type":"integer","minimum":0},"blocks_total":{"type":"integer","minimum":0}}},"fact_report":{"type":"object","properties":{"total":{"type":"integer","minimum":0},"kept":{"type":"integer","minimum":0},"groups":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"total":{"type":"integer","minimum":0},"kept":{"type":"integer","minimum":0}}}},"changed":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"type":{"type":"string"}}}}}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"WriteJob":{"type":"object","required":["id","status","blocks","progress","warnings","input_words","charged_words","created_at","finished_at"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["queued","rewriting","validating","completed","completed_with_warnings","needs_review","failed","cancelled"]},"mode":{"const":"write"},"output":{"type":"string"},"change_summary":{"type":"string"},"input_words":{"type":"integer","minimum":0},"charged_words":{"type":"integer","minimum":0},"refunded_words":{"type":"integer","minimum":0},"created_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"warnings":{"type":"array","description":"Deliver output with its warnings. On details_added, show the warning listing added details: \"Check added details before use: ...\". On first_person_added, show the warning listing added first-person words: \"Added first-person wording: ...\" or, when the list is absent, \"Added first-person wording. Check the rewrite.\". Do not retry details_added, first_person_added or sections_kept automatically. For the new rewrite policy, light and balanced deliver persistent first-person additions with completed_with_warnings; missing contains unique lowercase words with straight apostrophes. Strong keeps the affected source section and refunds it through sections_kept. These checks do not apply to older saved policies, REST direct mode or writing from a prompt. See /docs/api#first-person-wording for source context rules and the quotation limit. Rewrite meaning checks run silently with OpenAI when configured and may use one shared retry per section. Light and balanced deliver persistent meaning problems silently. Strong keeps and refunds a section through sections_kept only for a persistent critical added claim, changed fact or speaker problem. Material findings are delivered silently. Older saved policies keep their behavior. Unavailable checks fail open.","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"missing":{"type":"array","items":{"type":"string"}},"missing_count":{"type":"integer","minimum":0}}}},"blocks":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0},"text":{"type":"string"}}}},"progress":{"type":"object","properties":{"phase":{"enum":["queued","starting_model","writing","rewriting","validating",null]},"blocks_done":{"type":"integer","minimum":0},"blocks_total":{"type":"integer","minimum":0}}},"fact_report":{"type":"object","properties":{"total":{"type":"integer","minimum":0},"kept":{"type":"integer","minimum":0},"groups":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"total":{"type":"integer","minimum":0},"kept":{"type":"integer","minimum":0}}}},"changed":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"type":{"type":"string"}}}}}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}