# Create Text Completion — Featherless

> Generate a text completion from a raw prompt using a Featherless-hosted model (POST /v1/completions). Returns a completion object whose choices[0].text holds the generated text, plus a usage token breakdown. This is a distinct legacy-style…

- Key: `featherless-create-text-completion`
- Type: Action (Write)
- Version: 0.0.1
- App: Featherless (`featherless`) — https://pipedream.com/apps/featherless.md
- This page (HTML): https://pipedream.com/apps/featherless/actions/create-text-completion
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/featherless/actions/create-text-completion/create-text-completion.mjs

## Description

Generate a text completion from a raw prompt using a Featherless-hosted model (POST /v1/completions). Returns a completion object whose `choices[0].text` holds the generated text, plus a `usage` token breakdown. This is a distinct legacy-style completion endpoint from **Create Chat Completion**. Use **List Models** first to discover valid model IDs. Example: `model=Qwen/Qwen3-0.6B`, `prompt="The capital of France is"` returns ` Paris` in `choices[0].text`. [See the documentation](https://featherless.ai/docs/completions).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `model` | `string` | Yes | The model ID to use, e.g. Qwen/Qwen2.5-7B-Instruct. Run List Models first to discover valid model IDs available to your account (do NOT guess). |
| `prompt` | `string` | Yes | The prompt to complete. Accepts a plain string (e.g. The capital of France is) or a JSON array of strings (e.g. ["one","two"]); parsed in run() to pass a string or array to the API. |
| `maxTokens` | `integer` | No | Maximum number of tokens to generate (maps to max_tokens). |
| `minTokens` | `integer` | No | Minimum number of tokens to generate (maps to min_tokens). |
| `temperature` | `string` | No | Sampling temperature as a float, e.g. 0.7. Parsed to a number in run(). |
| `topP` | `string` | No | Nucleus sampling probability as a float, e.g. 0.9 (maps to top_p). |
| `topK` | `integer` | No | Top-k sampling cutoff (maps to top_k). |
| `minP` | `string` | No | Minimum probability threshold as a float, e.g. 0.05 (maps to min_p). |
| `presencePenalty` | `string` | No | Presence penalty as a float, e.g. 0.0 (maps to presence_penalty). |
| `frequencyPenalty` | `string` | No | Frequency penalty as a float, e.g. 0.0 (maps to frequency_penalty). |
| `repetitionPenalty` | `string` | No | Repetition penalty as a float, e.g. 1.0 (maps to repetition_penalty). |
| `seed` | `integer` | No | Random seed for deterministic sampling. |
| `stop` | `string[]` | No | One or more strings that stop generation when encountered. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "featherless",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "featherless-create-text-completion",
  arguments: {
    model: "Model",
    prompt: "Prompt",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "featherless-create-text-completion",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    featherless: { authProvisionId: "apn_xxxxxxx" },
    model: "Model",
    prompt: "Prompt",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "featherless-create-text-completion",
    "configured_props": {
      "featherless": { "authProvisionId": "apn_xxxxxxx" },
      "model": "Model",
      "prompt": "Prompt"
    }
  }'
```

---

- App: https://pipedream.com/apps/featherless.md · All apps: https://pipedream.com/apps
