Skip to content
中文

Count input tokens

POST/openai/v1/responses/input_tokens○ Unsupported

Official OpenAI docs ↗

Returns

501 This endpoint is not implemented yet; calling it returns the response below:

Counts the tokens the request input would consume without generating content. It depends on OpenAI Responses' official server-side storage (store) semantics, which we have not implemented yet; calling it returns 501 (message “This platform has not implemented … yet.”, with the x-should-retry header set to false), has no side effects, and the official SDK will not retry.

Errors follow the OpenAI format — see error codes

Request

curl
curl https://api.deepraxis.com/openai/v1/responses/input_tokens \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-flash","input":"你好"}'
Python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.deepraxis.com/openai/v1",
    api_key="$PRAXIS_API_KEY",
)

count = client.responses.input_tokens.count(
    model="deepseek-flash",
    input="你好",
)
TypeScript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.deepraxis.com/openai/v1",
  apiKey: "$PRAXIS_API_KEY",
});

const count = await client.responses.inputTokens.count({
  model: "deepseek-flash",
  input: "你好",
});

Response 501

{
  "error": {
    "message": "This platform has not implemented POST /v1/responses/input_tokens yet.",
    "type": "api_error",
    "param": null,
    "code": "internal"
  }
}

Response

HTTP 200

Native Responses API input token count

application/json

Name Type Description
$ object