SDK Installation

go get github.com/writerai/writer-client-sdk-go

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.

writer-auth

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

package main

import (
    "context"
    "log"
    "github.com/writerai/writer-client-sdk-go"
    "github.com/writerai/writer-client-sdk-go/pkg/models/shared"
    "github.com/writerai/writer-client-sdk-go/pkg/models/operations"
)

func main() {
    s := writerai.New()
    
    req := operations.ContentDetectorAPIRequest{
        PathParams: operations.ContentDetectorAPIPathParams{
            OrganizationID: 548814,
        },
        Headers: operations.ContentDetectorAPIHeaders{
            Authorization: "deserunt",
        },
        Request: shared.ContentDetectorRequest{
            Input: "porro",
        },
    }

    ctx := context.Background()
    res, err := s.AIContentDetector.ContentDetectorAPI(ctx, req)
    if err != nil {
        log.Fatal(err)
    }

    if res.ContentDetectorResponses != nil {
        // handle response
    }
}

SDK Available Operations

AIContentDetector

  • ContentDetectorAPI - Content detector api

Billing

  • GetSubscriptionDetails - Get your organization subscription details

CoWrite

  • GenerateContent - Generate content using predefined templates
  • GetTemplateInputs - Get a list of your existing CoWrite templates

Completions

  • Completions - Create completion for LLM model
  • CustomizationCompletions - Create completion for LLM customization model

Content

  • ContentCheck - Check your content against your preset styleguide.
  • ContetnCorrect - Apply the style guide suggestions directly to your content.

DownloadTheCustomizedModel

  • FetchCustomizedModelFile - Download your fine-tuned model (available only for Palmyra Base and Palmyra Large)

Files

  • DeleteFile - Delete file
  • Files - List files
  • GetFile - Get file
  • UploadFile - Upload file

FineTunes

  • CreateModelCustomization - Create model customization
  • Customizations - List model customizations
  • DeleteModelCustomization - Delete Model customization
  • GetModelCustomization - Get model customization

Models

  • Models - List available LLM models

Snippet

  • DeleteSnippets - Delete snippets
  • FindSnippets - Find snippets
  • UpdateSnippets - Update snippets

Styleguide

  • ListPages - List your styleguide pages
  • PageDetails - Page details

Terminology

  • AddTerms - Add terms
  • DeleteTerms - Delete terms
  • FindTerms - Find terms
  • UpdateTerms - Update terms

User

  • ListUsers - List users