API DocsAI Model APIsCompletions

Native OpenAI Format

Create text completions based on a given prompt

Native OpenAI Format

Create text completions based on a given prompt

Base URL

  • https://autorouter.top — Production

Authentication

BearerAuth: http (bearer) Authenticate using a Bearer Token. Format: Authorization: Bearer sk-xxxxxx

Endpoints

POST /v1/completions

Native OpenAI Format

Create text completions based on a given prompt

Request Body

Content-Type: application/json

Properties:

NameTypeRequiredDescription
modelstringYes-
promptoneOfYes-
max_tokensintegerNo-
temperaturenumberNo-
top_pnumberNo-
nintegerNo-
streambooleanNo-
stoponeOfNo-
suffixstringNo-
echobooleanNo-

Responses

200: Successfully created response

Content-Type: application/json

Request Example

curl -X POST "https://autorouter.top/v1/completions" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "string",
  "prompt": "string"
}'

Response Examples

{
  "id": "string",
  "object": "text_completion",
  "created": 0,
  "model": "string",
  "choices": [
    {
      "text": "string",
      "index": 0,
      "finish_reason": "string"
    }
  ],
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "text_tokens": 0,
      "audio_tokens": 0,
      "image_tokens": 0
    },
    "completion_tokens_details": {
      "text_tokens": 0,
      "audio_tokens": 0,
      "reasoning_tokens": 0
    }
  }
}

On this page