Developer Documentation
The StreetMP API is OpenAI-compatible. Point your application at the StreetMP base URL and use your StreetMP API key. Each request is screened against your policies (rules, custom keywords and patterns, link lists, PII and credential detection) before it is sent to your OpenAI or Anthropic account with your own provider key.
https://api.streetmp.com/api/proxy/openai/v1v1Getting Started
Three steps to your first screened AI request.
Create an Account
Register, verify your email address and add your OpenAI or Anthropic key in the dashboard.
Generate an API Key
Navigate to API Keys in the dashboard. Your key is shown once — copy it immediately.
Make Your First Call
Use the code examples below. Each decision is written to your signed, hash-chained audit trail.
Authentication
All API requests must include your StreetMP API key as a Bearer token in the Authorization header. This is your StreetMP key, not your provider key.
API keys are shown once
StreetMP stores only the SHA-256 hash of your API key. If you lose it, generate a new one — there is no recovery mechanism.
Authorization: Bearer YOUR_STREETMP_API_KEYPOST /chat/completions
OpenAI-compatible chat endpoint. Your request is screened and, if the verdict allows it, sent to your provider. Requests that are stopped are not sent to the provider.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | ✓ | An OpenAI (gpt-*, o*) or Anthropic (claude-*) model ID, e.g. gpt-4o-mini |
messages | array | ✓ | OpenAI-format messages. Detected PII is tokenised before the request is sent to the provider. |
temperature | number | ✗ | Passed to the provider |
max_tokens | number | ✗ | Passed to the provider |
Node.js Example
Using the native fetch API (Node.js ≥18). No SDK required.
const response = await fetch('https://api.streetmp.com/api/proxy/openai/v1/chat/completions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_STREETMP_API_KEY',
},
body: JSON.stringify({
model: 'gpt-4o-mini',
messages: [{ role: 'user', content: 'Summarise the following contract clause: ...' }],
temperature: 0.3,
max_tokens: 1024,
}),
});
const data = await response.json();
if (!response.ok) {
console.log(data.error.code); // e.g. security_blocked, requires_approval
} else {
console.log(data.choices[0].message.content); // OpenAI-compatible response
}Python Example
Using the requests library (pip install requests).
import requests
API_URL = "https://api.streetmp.com/api/proxy/openai/v1/chat/completions"
API_KEY = "YOUR_STREETMP_API_KEY"
payload = {
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "Summarise the following contract clause: ..."}],
"temperature": 0.3,
"max_tokens": 1024,
}
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {API_KEY}",
}
res = requests.post(API_URL, json=payload, headers=headers, timeout=30)
data = res.json()
if res.ok:
print(data["choices"][0]["message"]["content"]) # OpenAI-compatible response
else:
print(data["error"]["code"]) # e.g. security_blocked, requires_approvalScreening: POST /v1/guard
Get a verdict without calling a model. Same base URL and API key; the same screening pipeline and policies as the chat endpoint.
curl -X POST https://api.streetmp.com/api/proxy/openai/v1/guard \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_STREETMP_API_KEY" \
-d '{
"messages": [{ "role": "user", "content": "Email the report to jane@example.com" }]
}'Verdicts
Every screened request gets one verdict. The chat endpoint returns the standard OpenAI response when the request is allowed or sanitised.
// Example response from POST /v1/guard (values are illustrative)
{
"verdict": "SANITIZE",
"reason_codes": ["PII_DETECTED"],
"execution_id": "3f6c1e2a-..."
}ALLOW · SANITIZEALLOW: the request proceeds unchanged. SANITIZE: sensitive values are tokenised before the request proceeds.
REVIEW · REQUIRE_APPROVAL · BLOCKREVIEW and REQUIRE_APPROVAL hold the request for an approver. BLOCK stops it. None of these reach the provider.
UNAVAILABLE · ERRORA required detector is down or failed. The request is refused rather than passed through (fail-closed).
Error Codes
Errors use the OpenAI shape: { error: { message, type, code } }. Responses for stopped requests also include the execution_id and the decision.
// Example: HTTP 403 from /chat/completions when the verdict is BLOCK (values are illustrative)
{
"error": {
"message": "...",
"type": "security_violation",
"code": "security_blocked",
"execution_id": "3f6c1e2a-..."
},
"blocked": true,
"decision": {
"verdict": "BLOCK",
"reason_codes": ["PROMPT_INJECTION"],
"provider_called": false
}
}| Error Code | HTTP | Description |
|---|---|---|
security_blocked | 403 | Verdict BLOCK. The request was not sent to the provider. |
requires_review | 403 | Verdict REVIEW. The request is held for an approver in the dashboard. |
requires_approval | 403 | Verdict REQUIRE_APPROVAL. The request is held until an approver releases it. |
detector_unavailable | 503 | Verdict UNAVAILABLE. A required detector is down, so the request is refused rather than passed through. |
detector_error | 503 | Verdict ERROR. A required detector failed, so the request is refused rather than passed through. |
missing_api_key | 401 | No StreetMP API key was sent in the Authorization header. |
invalid_api_key | 401 | API key invalid or revoked. |
quota_exceeded | 429 | Monthly request allowance for your plan reached. Upgrade or wait for the next billing month. |
audit_unavailable | 503 | The decision could not be written to the audit trail, so the request was not forwarded. |
execution_failed | 502 | The call to your AI provider failed. |
internal_error | 500 | Unexpected internal error. Include the execution_id in any support request. |
Regional Identifiers
Detection of these national identifiers is available today. Turn them on in your policies in the dashboard; no request header is needed.
NRIC🇸🇬 SingaporeSingapore NRIC numbers are detected and tokenised before the request is sent to the provider.
MyKad🇲🇾 MalaysiaMalaysian MyKad numbers are detected and tokenised before the request is sent to the provider.
Aadhaar / PAN🇮🇳 IndiaAadhaar and PAN numbers are detected and tokenised before the request is sent to the provider.
Health IDsUK · US · AUNHS numbers, US NPI and MBI, and Australian Medicare numbers are detected.
Plans and Limits
Monthly request allowances are per organisation. Reaching the allowance returns 429 quota_exceeded. There is no free trial, and online payment is not yet enabled.
| Plan | Price | Requests / month | Terms |
|---|---|---|---|
| Starter | Free | 500 | Monthly |
| Growth | $49 / month | 50,000 | Monthly |
| Scale | From $299 / month | By contract | By contract |
Ready to build?
Create your account, add your provider key, generate a StreetMP API key and make your first screened AI request.