Using the API

Completions

Send a raw prompt in the Inkwell template when you need full control.

POST /v1/completions takes a raw prompt instead of messages. Use it when you want full control over the text the model sees, for example to continue a partial article. Most applications should use chat completions instead.

The prompt template

Inkwell was trained on a fixed template. Prompts that follow it produce the best articles. End the prompt right after the article heading.

Template
### Brief
{your brief}

### Article

The model ends an article with ### End. Pass it as a stop sequence along with ### Brief so generation stops cleanly.

Example

curl https://api.seosorted.ai/v1/completions \
  -H "Authorization: Bearer $SEOSORTED_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "inkwell-1",
    "prompt": "### Brief\nTopic: Why most home espresso tastes sour\nLength: about 400 words\n\n### Article\n",
    "max_tokens": 800,
    "stop": ["### End", "### Brief"]
  }'

The response is an OpenAI text_completion object. The article is in choices[0].text. Set stream to true to receive server-sent events, in the same way as chat completions.