Skip to content

API Reference ​

Chat Completions ​

POST https://api.platform.preferredai.jp/v1/chat/completions

This endpoint generates responses from generation AI models based on provided chat messages.

Currently, only the PLaMo Prime model is supported.

Model IDContext LengthMaximum Output TokensReasoning Capability
plamo-3.0-prime262,144 tokens20,480 tokensYes
plamo-3.1-prime262,144 tokens20,480 tokensYes

Sample Usage ​

For curl, set your PLaMo API key in an environment variable named PLAMO_API_KEY, and for Python libraries, set it in an environment variable named OPENAI_API_KEY.

Request ​

bash
$ curl \
    -H "Authorization: Bearer ${PLAMO_API_KEY}" \
    -H "Content-Type: application/json" \
    "https://api.platform.preferredai.jp/v1/chat/completions" \
    -d @- << EOF
{
  "messages": [
    {
      "role": "system",
      "content": "You are a travel advisor."
    },
    {
      "role": "user",
      "content": "Please recommend an optimal sightseeing route in Kanazawa from morning until evening."
    }
  ],
  "model": "plamo-3.0-prime"
}
EOF
python
import os
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    base_url="https://api.platform.preferredai.jp/v1",
    model="plamo-3.0-prime",
    streaming=True,
    # other parameters...,
)

messages=[
    {"role": "system", "content": "You are a travel advisor."},
    {"role": "user", "content": "Please recommend an optimal sightseeing route in Kanazawa from morning until evening."},
]

for chunk in llm.stream(messages):
    print(chunk.content, end="", flush=True)
python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.platform.preferredai.jp/v1",
    # other parameters...,
)

completion = client.chat.completions.create(
    model="plamo-3.0-prime",
    messages=[
        {"role": "system", "content": "You are a travel advisor."},
        {"role": "user", "content": "Please recommend an optimal sightseeing route in Kanazawa from morning until evening."},
    ],
    stream=True,
)

for chunk in completion:
    if chunk.choices and chunk.choices[0].delta.content is not None:
        print(chunk.choices[0].delta.content, end="", flush=True)

Response ​

json

{
    "id": "chat-eb6da3a371c546c8a8c4629794328c5b",
    "object": "chat.completion",
    "created": 1733220118,
    "model": "plamo-3.0-prime",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "The quadratic formula for solving second-degree equations is as follows:...",
                "tool_calls": []
            },
            "logprobs": null,
            "finish_reason": "stop",
            "stop_reason": null
        }
    ],
    "usage": {
        "prompt_tokens": 169,
        "total_tokens": 394,
        "completion_tokens": 225
    },
    "prompt_logprobs": null
}
json
data: {"id":"chat-e05656fa4721494a93d54410881f00c8","object":"chat.completion.chunk","created":1734345308,"model":"plamo-3.0-prime","choices":[{"index":0,"delta":{"role":"assistant"},"logprobs":null,"finish_reason":null}],"usage":{"prompt_tokens":143,"total_tokens":143,"completion_tokens":0}}

data: {"id":"chat-e05656fa4721494a93d54410881f00c8","object":"chat.completion.chunk","created":1734345308,"model":"plamo-3.0-prime","choices":[{"index":0,"delta":{"content":"PL"},"logprobs":null,"finish_reason":null}],"usage":{"prompt_tokens":143,"total_tokens":144,"completion_tokens":1}}

data: {"id":"chat-e05656fa4721494a93d54410881f00c8","object":"chat.completion.chunk","created":1734345308,"model":"plamo-3.0-prime","choices":[{"index":0,"delta":{"content":"a"},"logprobs":null,"finish_reason":null}],"usage":{"prompt_tokens":143,"total_tokens":145,"completion_tokens":2}}

data: {"id":"chat-e05656fa4721494a93d54410881f00c8","object":"chat.completion.chunk","created":1734345308,"model":"plamo-3.0-prime","choices":[{"index":0,"delta":{"content":"Mo"},"logprobs":null,"finish_reason":null}],"usage":{"prompt_tokens":143,"total_tokens":146,"completion_tokens":3}}

data: {"id":"chat-e05656fa4721494a93d54410881f00c8","object":"chat.completion.chunk","created":1734345308,"model":"plamo-3.0-prime","choices":[{"index":0,"delta":{"content":""},"logprobs":null,"finish_reason":"stop","stop_reason":null}],"usage":{"prompt_tokens":143,"total_tokens":148,"completion_tokens":5}}

data: {"id":"chat-e05656fa4721494a93d54410881f00c8","object":"chat.completion.chunk","created":1734345308,"model":"plamo-3.0-prime","choices":[],"usage":{"prompt_tokens":143,"total_tokens":148,"completion_tokens":5}}

data: [DONE]

For the /chat/completions endpoint, models supporting reasoning capabilities support both reasoning and reasoning_content. Non-streaming responses include reasoning and reasoning_content within each choice.message, while streaming responses (when stream: true) incrementally include reasoning and reasoning_content in each chunk's choice.delta.

Request Parameters ​

Please include the following parameters in the request body in JSON format.

ParameterTypeRequiredDefault ValueDescription
modelstringrequiredSpecifies the ID of the model to use.
messagesarray of MessageObjectrequiredSets the list of chat messages. Each message must include a role and content.
frequency_penaltyfloatoptional0.0Controls the frequency of token repetition. Valid values range from -2.0 to 2.0.
max_tokensinteger or nulloptional20480Stops generation once the specified number of tokens have been produced. Depending on the resulting content, generation may terminate earlier. Cannot be set to exceed the model's maximum output token limit.
nintegeroptional1Specifies the number of times to generate content in a single request. Valid values are 1 or 2.
presence_penaltyfloatoptional0.0Applies a penalty for tokens that have already appeared in the output. Valid values range from -2.0 to 2.0.
reasoningReasoningObjectoptionalnullAllows configuration of reasoning-related settings.
reasoning_effortnone or mediumoptionalnoneSpecifies the level of reasoning to perform. Only none (no reasoning) or medium (standard amount of reasoning) are supported. If effort is specified in reasoning, this setting will be ignored.
response_formatResponseFormatObject or nulloptionalnullSpecifies the response output format. Set { "type": "json_schema", "json_schema": {...} } to generate a JSON response that follows the supplied JSON Schema.
seedinteger or nulloptionalnullSpecifies the random seed for token generation. Depending on internal state, different results may occur even when using the same seed value.
safety_identifierstring or nulloptionalnullAn identifier for user identification. This may be used by the PLaMo API side to detect anomalies or other issues. Since it may be persisted on the server, do not include any personal information or sensitive data.
stoparray of strings, strings, or nulloptionalnullStops generation when any of the specified words are encountered.
streambooleanoptionalfalseSet to 'true' when using streaming responses.
stream_optionsStreamOptionObject or nulloptionalnullSpecify options when enabling streaming. See StreamOptionObject below for details.
temperaturefloatoptional0.3Specifies the sampling temperature. Valid values range from 0 to 2.0.
toolsarray of ChatCompletionToolsObjectoptionalnullDefines the functions to be used for Function Calling.
tool_choiceChatCompletionToolChoiceObject or "none" or "auto" or "required"optionalnullSpecifies the function to be invoked.
top_pfloatoptional1.0Controls how far into the token generation results to consider. Valid values range from 0 to 1.0.
web_search_optionsWebSearchOptionsObject or nulloptionalnullSearches the web and answers with citations based on the search results. See Web Search for details.

Response (when not using streaming) ​

FieldTypeDescription
idstringA unique ID assigned for each message.
choicesarray of ChoiceObjectReturns chat-style generation results.
createdintegerReturns the generated UNIX timestamp.
modelstringReturns the model ID.
objectstringAlways returns 'chat.completion'.
usageUsageObjectReturns an object containing usage statistics.
plamo_usage_detailsarray of PlamoUsageDetailObject or nullPLaMo's usage details breakdown (web search counts, tokens, etc.).

Response Format (When Streaming is Used) ​

The response is returned using server-sent events. The response will conclude with an event: [DONE].

FieldTypeDescription
idstringA unique ID assigned for each message.
choicesarray of StreamChoiceObjectReturns chat-style generation results.
createdintegerUnix timestamp of when the generation was completed.
modelstringReturns the model ID.
objectstringAlways returns 'chat.completion.chunk'.
usageUsageObject or nullReturns an object containing usage statistics.
plamo_usage_detailsarray of PlamoUsageDetailObject or nullPLaMo's usage details breakdown. Included in the final usage chunk.

Important Note about max_tokens ​

Currently, the API will output an error when the sum of input tokens + max_tokens exceeds the model's context length. Even if the actual generated output contains fewer tokens than the context length when rendered, the API will still produce an error during the input phase.

Specifically, if max_tokens is not explicitly set, it defaults to 20480, which means an error will occur even if the input length is below the context limit. In such cases, please explicitly specify max_tokens to ensure that input tokens + max_tokens does not exceed the model's context length.

When web_search_options is specified, the model searches the web as needed and answers with citations based on the search results. The supported model is plamo-3.1-prime.

Request ​

bash
$ curl \
    -H "Authorization: Bearer ${PLAMO_API_KEY}" \
    -H "Content-Type: application/json" \
    "https://api.platform.preferredai.jp/v1/chat/completions" \
    -d @- << EOF
{
  "model": "plamo-3.1-prime",
  "messages": [
    {"role": "user", "content": "Where is the head office of Preferred Networks?"}
  ],
  "web_search_options": {
    "search_context_size": "low",
    "user_location": {
      "type": "approximate",
      "approximate": {"country": "JP", "city": "Tokyo", "timezone": "Asia/Tokyo"}
    }
  }
}
EOF

Response ​

json
{
    "id": "chatcmpl-621c7cbd-a821-48b1-90b9-70c142934562",
    "object": "chat.completion",
    "model": "plamo-3.1-prime",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "The head office of Preferred Networks is in Otemachi Building, 1-6-1 Otemachi, Chiyoda-ku, Tokyo. ([preferred.jp](https://www.preferred.jp/en/company))",
                "annotations": [
                    {
                        "type": "url_citation",
                        "url_citation": {
                            "url": "https://www.preferred.jp/ja/company",
                            "title": "Company - Preferred Networks, Inc.",
                            "start_index": 52,
                            "end_index": 93
                        }
                    }
                ],
                "tool_calls": []
            },
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 20796,
        "completion_tokens": 383,
        "total_tokens": 21179
    },
    "plamo_usage_details": [
        {"model": "plamo-3.1-prime", "usage_type": "main_response", "input_tokens": 20796, "output_tokens": 383, "token_consumed": 21179},
        {"model": "web_search_basic", "usage_type": "web_search", "input_tokens": 1, "output_tokens": 0, "token_consumed": 1}
    ]
}
  • The answer text carries a source link in the form ([domain](URL)) after each passage quoted from a page.
  • message.annotations lists the sources the answer cites as url_citation. start_index / end_index point to the cited span in the text; a citation of search results points to a zero-width position at the end of the sentence.
  • The number of searches is the token_consumed of the plamo_usage_details entry whose usage_type is web_search. Charges are based on the number of tokens and the number of searches.
  • reasoning_effort and reasoning (including summary) can be specified. With stream, the answer arrives after the search.
  • When response_format specifies a JSON Schema, the answer follows that format and carries no citations.
  • When the output limit is reached, finish_reason is length.
  • The following parameters cannot be specified (a 400 error is returned): temperature, top_p, presence_penalty, frequency_penalty, n, seed, stop, logprobs, tools, tool_choice.
  • Web search cannot be used with messages that contain images.

Deep Research API ​

POST https://api.platform.preferredai.jp/v1/responses

Searches the web repeatedly on a question and writes a report with citations. It runs as an asynchronous job in the same shape as the OpenAI Responses API with background: true: creating it immediately returns a Response object with status: "queued". Generation takes several minutes to tens of minutes, so retrieve the result with the returned id.

Model IDDescription
plamo-3.1-prime-deep-researchThe model for Deep Research. Any other model ID does not run Deep Research.

Sample Usage ​

Request ​

bash
$ curl \
    -H "Authorization: Bearer ${PLAMO_API_KEY}" \
    -H "Content-Type: application/json" \
    "https://api.platform.preferredai.jp/v1/responses" \
    -d @- << EOF
{
  "model": "plamo-3.1-prime-deep-research",
  "input": "Research recent trends in generative AI regulation in Japan",
  "background": true
}
EOF

Response ​

json
{
    "id": "resp_3f9a1c...",
    "object": "response",
    "created_at": 1791272415.0,
    "status": "queued",
    "background": true,
    "model": "plamo-3.1-prime-deep-research",
    "output": [],
    "usage": null,
    "tool_usage": null,
    "error": null,
    "tools": [{"type": "web_search"}],
    "max_tool_calls": 100,
    "incomplete_details": null
}
json
{
    "id": "resp_3f9a1c...",
    "object": "response",
    "status": "completed",
    "output": [
        {
            "type": "web_search_call",
            "id": "ws_...",
            "status": "completed",
            "action": {"type": "search", "query": "generative AI regulation Japan", "queries": ["generative AI regulation Japan"]}
        },
        {
            "type": "reasoning",
            "id": "rs_...",
            "summary": [{"type": "summary_text", "text": "..."}]
        },
        {
            "type": "message",
            "id": "msg_...",
            "role": "assistant",
            "status": "completed",
            "content": [
                {
                    "type": "output_text",
                    "text": "# Generative AI Regulation in Japan\n\n...",
                    "annotations": [
                        {"type": "url_citation", "start_index": 120, "end_index": 180, "url": "https://...", "title": "..."}
                    ]
                }
            ]
        }
    ],
    "usage": {"input_tokens": 182340, "output_tokens": 21530, "total_tokens": 203870},
    "tool_usage": {"web_search": {"num_requests": 18}}
}

Retrieving the Result ​

EndpointDescription
GET /v1/responses/{id}Returns the job's current Response object. status moves from queued to in_progress and ends as completed, incomplete, failed, or cancelled.
GET /v1/responses/{id}?stream=trueReturns the progress as server-sent events, starting from the events that have already occurred. If the connection drops, pass the sequence_number of the last event you received as starting_after to resume from there.
POST /v1/responses/{id}/cancelCancels the job. A cancelled job ends with status: "cancelled".

The stream carries the same response.* events as the OpenAI Responses API. The main events are:

  • response.queued / response.in_progress / response.completed
  • response.output_item.added / response.web_search_call.searching
  • response.reasoning_summary_text.delta
  • response.output_text.delta / response.output_text.annotation.added

Results are kept for 24 hours after creation. A job created by another tenant cannot be retrieved (404 is returned).

Request Parameters ​

Please include the following parameters in the request body in JSON format. Any parameter not listed here returns an error.

ParameterTypeRequiredDefault ValueDescription
modelstringrequiredSpecify plamo-3.1-prime-deep-research.
inputstring or array of MessageObjectrequiredWhat to research. For an array, the last user message is the question, and assistant messages after it are used as the research plan. system messages are not used.
backgroundbooleanrequiredSpecify true. Any other value returns an error.
streambooleanoptionalfalsetrue is not supported at creation. Get the progress with GET /v1/responses/{id}?stream=true.
toolsarrayoptionalnullRestricts the source domains in the form [{"type": "web_search", "filters": {"allowed_domains": [...], "blocked_domains": [...]}}]. No tool other than web_search and no option other than filters can be specified.
max_tool_callsintegeroptional100The maximum total number of searches, page opens, and in-page finds in one job. Valid values range from 1 to 100. Once the limit is reached, the remaining chapters are left out.
includearray of stringoptionalnullSpecify ["web_search_call.action.sources"] to include the search result URLs in action.sources of each web_search_call.
metadataobjectoptionalnullAny string keys and values.
storebooleanoptionalnullAccepted for compatibility with the OpenAI Responses API. Regardless of the value, results are kept for 24 hours after creation.

Notes ​

  • A job runs for at most about 25 minutes. Past that, it ends with status: "failed" and error.code: "timeout".
  • If part of the research (such as writing a chapter heading) fails, that part is skipped, the report is written to the end, and the job ends with status: "incomplete". What is missing is written in the summary of a reasoning item.
  • Charges are based on the tokens used to write the report and the number of searches in tool_usage.web_search.num_requests.

Tokenize API ​

POST https://api.platform.preferredai.jp/v1/tokenize

Converts a given string into tokens and returns both the token sequence and the total number of tokens.

Note that in Chat Completion, the text will be converted to a chat format, so various prompts will be automatically inserted. Therefore, the token count returned here may not strictly match the actual number of tokens generated in the final text output.

Also, since PLaMo uses the same Tokenizer as this publicly available model, you can integrate similar functionality directly into your own system rather than using the API.

Example Usage ​

Request ​

bash
$ curl \
    -H "Authorization: Bearer ${PLAMO_API_KEY}" \
    -H "Content-Type: application/json" \
    "https://api.platform.preferredai.jp/v1/tokenize" \
    -d '{"prompt": "Hello", "model": "plamo-3.0-prime"}'

Response ​

bash
{
    "count": 4,
    "max_model_len": 16384,
    "tokens": [
        1,
        1,
        35913,
        37607
    ]
}

Request Parameters ​

Specify the following parameters in JSON format within the request body.

ParameterTypeRequiredDefault ValueDescription
modelstringyesSpecify the ID of the model to be used.
promptstringEither messages or prompt must be specifiedSpecify the string for which you want to calculate tokens.
messagesarray of MessageObjectEither messages or prompt must be specifiedSpecify the strings for which you want to calculate tokens. The same format as chat messages used in the Chat Completions endpoint can be used.
add_special_tokensbooleannotrueSpecify whether to add special tokens like BOS.
add_generation_promptbooleannotrueSpecify whether to apply internal generation prompts during tokenization. This option is only valid when messages are specified.

Response ​

FieldTypeDescription
countintegerTotal number of tokens.
max_model_lenintegerMaximum number of tokens the model can process.
tokensarray of integerThe actual token sequence.

Models API ​

Retrieves data including available models.

Example ​

Request ​

For curl, set your PLaMo API key in the PLAMO_API_KEY environment variable, and for Python libraries, set it in the OPENAI_API_KEY environment variable.

bash
$ curl \
    -H "Authorization: Bearer ${PLAMO_API_KEY}" \
    -H "Content-Type: application/json" \
    "https://api.platform.preferredai.jp/v1/models"
python
from openai import OpenAI
client = OpenAI(
    base_url="https://api.platform.preferredai.jp/v1",
)

models = client.models.list()
print(models)

model_name = models.data[0].id
model = client.models.retrieve(model_name)
print(model)

Response ​

json
{
    "data": [
        {
            "id": "plamo-3.0-prime",
            "created": 1732978800,
            "object": "model",
            "owned_by": "system",
            "max_model_len": 262144
        }
    ],
    "object": "list"
}

Index Models ​

GET https://api.platform.preferredai.jp/v1/models

Retrieves a list of available models.

Response ​

FieldTypeDescription
objectstringAlways contains the value list.
dataarray of ModelObjectReturns an array of model objects

Get Model Details ​

GET https://api.platform.preferredai.jp/v1/models/{model}

Fetches detailed information about a specified model.

Path Parameters ​

ParameterTypeRequiredDescription
modelstringyesSpecifies the ID of the model to retrieve.

Response ​

Returns a ModelObject.

Object List ​

MessageObject ​

Represents a chat message, primarily consisting of System, User, and Assistant components.

ParameterTypeRequiredDefault ValueDescription
contentstringyesSpecifies the content of the message.
rolestringyesIndicates the role of the message; must be one of 'system', 'user', or 'assistant'.
namestringnoA name used for further identification when the same role is referenced.
reasoningstringnoSets the reasoning provided in the response.
reasoning_contentstringnoSets the reasoning_content provided in the response.

ReasoningObject ​

Specifies parameters related to reasoning.

ParameterTypeRequiredDefault ValueDescription
summarystringnonullSpecifies whether to generate a summary of the reasoning content. Can be one of 'auto', 'concise', or 'detailed'. If not specified, summary generation is disabled. Note that tokens used for summary generation will be counted as token usage.
effortnone or mediumnononeAllows selection of reasoning intensity. Supported options are none (no reasoning) or medium (standard amount of reasoning). Takes precedence over reasoning_effort.

ResponseFormatObject ​

Specifies the response output format.

ParameterTypeRequiredDefault ValueDescription
typestringyesMust be set to json_schema.
json_schemaResponseFormatJsonSchemaObjectyesDefines the JSON structure that the model should generate, expressed as JSON Schema.

ResponseFormatJsonSchemaObject ​

Specifies the JSON Schema configuration used for Structured Outputs.

ParameterTypeRequiredDefault ValueDescription
namestringyesThe name of the response format.
descriptionstring or nullnonullA description of the response format.
schemaobjectyesThe JSON Schema object that the response should follow. For the JSON Schema specification, see JSON Schema.
strictbooleannofalseWhen set to true, the model will generate responses that strictly follow the structure defined by schema. Supported JSON Schema features are limited.

StreamOptionObject ​

Specifies options when using streaming responses.

ParameterTypeRequiredDefault ValueDescription
include_usagebooleannoSpecifies whether to return usage statistics just before the streaming response completes.

ChatCompletionToolsObject ​

Defines the functions to be used with the Function Calling feature.

FieldTypeDescription
typestringMust be set to 'function'.
functionChatCompletionsToolsFunctionObjectDefines the actual function to be used with Function Calling.

ChatCompletionToolsFunctionObject ​

Defines the actual function implementation.

FieldTypeDescription
namestringThe name of the function.
descriptionstringA description of the function.
parametersstringDefinition of arguments that can be passed to the function, expressed in JSON Schema. For details on JSON Schema, see: https://json-schema.org/understanding-json-schema

ChatCompletionToolChoiceObject ​

Specifies which function to use.

FieldTypeDescription
typestringMust be set to 'function'.
functionChatCompletionToolChoiceFunctionObjectSpecifies the function to use.

ChatCompletionToolChoiceFunctionObject ​

Specifies the function details.

FieldTypeDescription
namestringSpecifies the name of the function specified in the 'tools' parameter.

ChoiceObject ​

Represents the result of generating a response in chat format.

FieldTypeDescription
indexintegerReturns the index of the object when multiple ChoiceObjects are available.
finish_reason'stop' or 'length'Returns 'stop' if the specified word was encountered or if generation naturally concluded; returns 'length' if the maximum token limit was exceeded.
logprobsnullCurrently not supported.
messageChatMessageObjectReturns the content of the generated message.
stop_reasoninteger, string, or nullCurrently not supported.

ChatMessageObject ​

Represents the content of a generated message.

FieldTypeDescription
contentstringReturns the message content.
reasoningstring or nullReturns the model's reasoning process. This field may only be present for models supporting reasoning.
reasoning_contentstring or nullContains the same content as reasoning.
annotationsarray or nullWith web search, returns the sources the answer cites as url_citation. See Web Search for details.
rolestringReturns the role of the message, which can be one of 'system', 'user', or 'assistant'.
tool_callsChatMessageToolCallsObjectInformation about Function Calling generated by the model.

ChatMessageToolCallsObject ​

Indicates the result of a function call.

FieldTypeDescription
idstringA unique identifier.
typestringMust be 'function'.
functionChatMessageToolCallsFunctionObjectInformation about the Function called via Function Calling.

ChatMessageToolCallsFunctionObject ​

Information about the called Function.

FieldTypeDescription
namestringIndicates the name of the Function.
argumentsstringFunction arguments specified in JSON format.

StreamChoiceObject ​

Represents the result of generated chat messages in a stream format.

FieldTypeDescription
indexintegerReturns the index of the object when multiple ChoiceObject instances exist.
finish_reason'stop' or 'length'Returns stop if the specified word is encountered or generation ends naturally, and length if the maximum generated token count is exceeded.
logprobsnullCurrently not supported.
deltaChatMessageDeltaObjectReturns the content of the additionally generated message.
stop_reasoninteger or string or nullCurrently not supported.

ChatMessageDeltaObject ​

Represents the content of a message in a stream format.

FieldTypeDescription
contentstringReturns the content of the message. The content field may be absent in cases such as when a role assignment is emitted.
reasoningstring or nullReturns the model's reasoning process. This field may be present only for models that support reasoning.
reasoning_contentstring or nullContains the same content as reasoning.
annotationsarray or nullWith web search, returns the cited sources as url_citation. In streaming, it is included in the final chunk.
rolestringReturns the role of the message, which is one of system, user, or assistant. This field is set only when a new role is assigned.

WebSearchOptionsObject ​

Specifies the web search settings.

ParameterTypeRequiredDefault ValueDescription
search_context_sizelow or medium or highoptionalmediumHow much of the answer's context goes to search results: low uses 1/4, medium 1/2, and high all of it.
user_locationobject or nulloptionalnullThe user's approximate location, in the form {"type": "approximate", "approximate": {"country": "JP", "city": "Tokyo", "region": "Tokyo", "timezone": "Asia/Tokyo"}}. Each field of approximate can be omitted.
filtersobject or nulloptionalnullRestricts the source domains in the form {"allowed_domains": ["example.com"]}. 1 to 100 domains can be specified.

UsageObject ​

Indicates token generation results and related information.

FieldTypeDescription
completion_tokensintegerReturns the number of generated tokens.

PlamoUsageDetailObject ​

Indicates PLaMo-specific breakdown per model and usage type.

FieldTypeDescription
modelstringThe model or pseudo-model name used (e.g. plamo-3.1-prime, web_search_basic).
usage_typestringThe usage type (e.g. main_response, web_search).
input_tokensintegerNumber of input tokens (or web search request count).
output_tokensintegerNumber of output tokens.
token_consumedintegerTotal consumed token count (or billing unit).

ModelObject ​

Indicates information about a model.

FieldTypeDescription
idstringA string that identifies the model. It can be used as an API parameter.
createdintegerThe time when the model was created.
objectstringThe type of this object. Currently, this field is always model.
owned_bystringThe owner of the model. Currently, this field is always system.
max_model_lenintegerThe maximum number of tokens a single request can use, counting the prompt and the generated text together.

Old API Endpoints ​

The API endpoints under https://platform.preferredai.jp/api/completion/v1 have been migrated. The new endpoint is https://api.platform.preferredai.jp/v1.

The old API endpoints remain available, but they are deprecated. Please use the new API endpoints.