These are the docs for Trigger.dev v2 which will be deprecated on January 31st, 2025. You probably want the v3 docs.

Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position. We recommend most users use the Chat Completions API. Learn more

create()

This is a legacy API

Creates a completion for the provided prompt and parameters. Official OpenAI docs

example.ts
const completion = await io.openai.completions.create("completion", {
  model: "text-davinci-003",
  prompt: "Create a good programming joke about Tasks",
});