Skip to main content

LLM Gateway Reference

The LLM Gateway provides OpenAI / Anthropic-compatible LLM endpoints (SaaS only). Requests and responses conform to each provider's native format, so you can use existing OpenAI SDKs / Anthropic SDKs as-is.

Base URL

CompatibilityBase URL
OpenAIhttps://api.fd.agenticstar.tm.softbank.jp/llm/v1
Anthropichttps://api.fd.agenticstar.tm.softbank.jp/llm

Authentication

MethodHeader
API key (OpenAI)Authorization: Bearer agtstr_...
API key (Anthropic)x-api-key: agtstr_...
Access token (CC flow)Authorization: Bearer <access_token>

For how to create API keys and clients, see Setup.

Common Specifications

  • model is required in the request body. Retrieve available models with GET /v1/models.
  • The request body limit is 32MB.
  • If IP restriction is configured, requests from disallowed networks return 403.

CORS

The LLM Gateway is intended for server-side use, and direct calls from browsers (cross-origin) are not allowed by default. Browser requests that include an Origin header are blocked unless an opt-in header is present (server-to-server calls send no Origin, so they are unaffected).

To call it directly from a browser, add one of the following headers to allow cross-origin access (Access-Control-Allow-Origin: * is returned):

HeaderDescription
anthropic-dangerous-direct-browser-access: trueThe Anthropic SDK's direct-browser-access flag.
x-agenticstar-allow-browser-access: trueAn equivalent custom header.
warning

Calling directly from a browser exposes your API key to the client. Manage API keys on the server side and limit direct browser calls to trusted use cases.

Endpoint List

MethodPathCompatibilityDescription
POST/llm/v1/chat/completionsOpenAIChat completion
POST/llm/v1/responsesOpenAIResponses API
POST/llm/v1/embeddingsOpenAIEmbedding vector generation
GET/llm/v1/modelsOpenAIList of available models
POST/llm/v1/messagesAnthropicMessage generation
POST/llm/v1/messages/count_tokensAnthropicToken counting

The request / response details of each endpoint conform to the official OpenAI / Anthropic specifications.

Request Examples

The request / response specifications of each endpoint conform to the official OpenAI / Anthropic specs. Representative call examples are shown below.

OpenAI

POST/llm/v1/chat/completions

Chat completion
1curl https://api.fd.agenticstar.tm.softbank.jp/llm/v1/chat/completions \
2-H "Authorization: Bearer agtstr_..." \
3-H "Content-Type: application/json" \
4-d '{
5 "model": "<model ID>",
6 "messages": [{"role": "user", "content": "Hello"}]
7}'

Anthropic

POST/llm/v1/messages

Create a message
1curl https://api.fd.agenticstar.tm.softbank.jp/llm/v1/messages \
2-H "x-api-key: agtstr_..." \
3-H "anthropic-version: 2023-06-01" \
4-H "Content-Type: application/json" \
5-d '{
6 "model": "<model ID>",
7 "max_tokens": 1024,
8 "messages": [{"role": "user", "content": "Hello"}]
9}'

Streaming

Specify "stream": true in the request body to receive the response incrementally over SSE (Server-Sent Events). The format conforms to each provider's native streaming format.

OpenAIdata: {chunk} lines are sent and the stream ends with data: [DONE].

data: {"choices":[{"delta":{"content":"He"}}]}

data: {"choices":[{"delta":{"content":"llo"}}]}

data: [DONE]

Anthropic — events are delivered as event: / data: pairs (message_startcontent_block_delta … → message_stop).

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"He"}}

event: message_stop
data: {"type":"message_stop"}

Errors

The main HTTP status codes that may be returned on error:

StatusDescription
400 Bad RequestInvalid request (missing model, invalid JSON, requested model unavailable, blocked by the content filter, etc.)
401 UnauthorizedAPI key / access token is invalid or missing
403 ForbiddenAccess from a network not allowed by IP restriction
404 Not FoundThe specified model does not exist
413 Payload Too LargeThe request body exceeds 32MB
429 Too Many RequestsRate limit or quota exceeded. Temporary rate limits include Retry-After; hard quotas (e.g. daily budget) include x-should-retry: false
501 Not ImplementedThe endpoint is not supported by the target provider (e.g. the Responses API)
502 Bad GatewayCommunication error with the upstream provider, etc.

Error Response Format

The error body is returned in the native error format of the endpoint's provider family.

OpenAI

JSON
{
"error": {
"type": "invalid_request_error",
"message": "Missing required parameter: model.",
"code": "missing_model"
}
}

Anthropic

JSON
{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Missing required parameter: model."
}
}

Usage Logs

Usage (model, token count, cost, latency, etc.) can be viewed via the llm-gateway-logs endpoint in the Admin API Reference or in the admin panel (Admin).