API endpoints
API routes and the OpenAPI specification
They all go after the https://alprouter.com/api/v1.
| Method | Address: | Keys | What they do |
|---|---|---|---|
| POST | /chat/completions | It’s necessary. | Conversing (In OpenAI format) |
| GET · PUT · DELETE | /memory/preferences | Key from an organization with Amem enabled | Read, save and delete Amem preferences |
| POST | /responses | It’s necessary. | Conversations (In OpenAI-style format) |
| POST | /messages | It’s necessary. | Conversational form (Anthropic format, Claude model) |
| POST | /messages/count_tokens | It’s necessary. | Counting the number of input tokens |
| POST | /embeddings | It’s necessary. | Turn text into vectors |
| POST | /videos | It’s necessary. | Submit a request for creating a video. |
| GET | /videos/{id} | It’s necessary. | Status and fees of the video work |
| GET | /videos/{id}/content | It’s necessary. | Receive the created video files |
| GET | /videos/models | Without it | Video models and the parameters such as resolution, price, etc. |
| GET | /models | Without it | Model and Price List |
| GET | /models/{Company}/{Model}/endpoints | Without it | Models connected to the suppliers, and prices |
| GET | /providers | Without it | List of Suppliers |
| GET | /generation?id= | It’s necessary. | One request’s usage and fees |
| GET · POST | /keys | Management-related | Key list, Key creation |
| GET · PATCH · DELETE | /keys/{id} | Management-related | Seeing, fixing, and removing a key |
| GET | /key | It’s necessary. | The amount and limits of the use of keys |
| GET | /credits | It’s necessary. | Charged credits, used credits, remaining credits |
OpenAPI File
The OpenAPI 3.1 file, which contains the format of the requests and responses, can be obtained from https://alprouter.com/api/v1/openapi.json. This file can be used when creating an API client or for reading by tools.
Being trapped within AI tools
The file that summarizes the document contents in text is located at https://alprouter.com/llms.txt.
Prompt security rules
Your organization sets separate policies for personal data and API keys. In Mask mode, only values that match the formats below are replaced. In Block mode, the request stops before it reaches the model. Checks include conversation history. Operator instructions and tool definitions can be excluded from personal data checks only.
| Replacement | Formats checked |
|---|---|
[EMAIL] | ASCII email addresses |
[PHONE] | International numbers with a country calling code, plus Korean numbers with the prefixes 010, 011, 016–019, 02 and 070 and area codes 031–033, 041–044, 051–055 and 061–064. Korean numbers can use domestic or +82 notation and full-width digits. |
[RRN] | Hyphenated Korean resident and foreign resident registration numbers that encode a valid date of birth |
[CARD] | Card numbers that match an issuer range and length and pass the Luhn check |
[API_KEY] | AlpRouter, OpenAI and Anthropic keys, Anthropic OAuth tokens, AWS access key IDs, GitHub tokens, Google API keys, Slack tokens, Stripe live keys and PEM private keys (including JSON-escaped keys) |
Key checks match formats without looking up whether a credential was issued. Personal data rules exclude names, addresses, passport numbers, driver’s license numbers, bank account numbers and unhyphenated 13-digit registration numbers. Attachments and text in images are outside the inspection scope.
Response headers
Injection flags cover user input and tool results after the last assistant turn. System instructions and earlier turns are skipped. Token counting uses the same scope. Transcription and video requests check the prompt. Embeddings skip injection checks.
| Header | Meaning/Interpretation |
|---|---|
x-request-id | It’s used when looking up or asking about requests from the “request id” or “generation” category. |
retry-after | Time to wait in seconds: 429 and 503 |
x-ratelimit-limit | The number of times this key can be pressed per minute |
x-ratelimit-remaining | In this 1-minute period, the remaining times are: |
x-ratelimit-reset | Time remaining (in seconds) until the count is replenished again |
x-alprouter-prompt-injection | In Flag mode, a comma-separated list of matching injection rule IDs. Sent only when a rule matches. |
x-alprouter-dropped | Items that were removed from /messages and /responses before sending. |