Python SDK
SDK Installation
pip install writerai
Authentication
Writer authenticates your API requests using your account’s API keys. If you do not include your key when making an API request, or use one that is incorrect or outdated, Writer returns an error.
Your API keys are available in the account dashboard. We include randomly generated API keys in our code examples if you are not logged in. Replace these with your own or log in to see code examples populated with your own API keys.

If you cannot see your secret API keys in the Dashboard, this means you do not have access to them. Contact your Writer account owner and ask to be added to their team as a developer.
SDK Example Usage
import writer
from writer.models import operations, shared
s = writer.Writer(
security=shared.Security(
api_key="YOUR_API_KEY_HERE",
),
organization_id=548814,
)
req = operations.DetectContentRequest(
content_detector_request=shared.ContentDetectorRequest(
input="example",
),
)
res = s.ai_content_detector.detect(req)
if res.content_detector_responses is not None:
# handle response
SDK Available Operations
ai_content_detector
detect
- Content detector api
billing
get_subscription_details
- Get your organization subscription details
co_write
generate_content
- Generate content using predefined templateslist_templates
- Get a list of your existing CoWrite templates
completions
create
- Create completion for LLM modelcreate_model_customization_completion
- Create completion for LLM customization model
content
check
- Check your content against your preset styleguide.correct
- Apply the style guide suggestions directly to your content.
download_the_customized_model
fetch_file
- Download your fine-tuned model (available only for Palmyra Base and Palmyra Large)
files
delete
- Delete fileget
- Get filelist
- List filesupload
- Upload file
model_customization
create
- Create model customizationdelete
- Delete Model customizationget
- Get model customizationlist
- List model customizations
models
list
- List available LLM models
snippet
delete
- Delete snippetsfind
- Find snippetsupdate
- Update snippets
styleguide
get
- Page detailslist_pages
- List your styleguide pages
terminology
add
- Add termsdelete
- Delete termsfind
- Find termsupdate
- Update terms
user
list
- List users
Updated about 2 months ago