OpenAI-compatible · REST API

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.

Base URL: https://api.streetmp.com/api/proxy/openai/v1
Version: v1
01

Getting Started

Three steps to your first screened AI request.

1

Create an Account

Register, verify your email address and add your OpenAI or Anthropic key in the dashboard.

2

Generate an API Key

Navigate to API Keys in the dashboard. Your key is shown once — copy it immediately.

3

Make Your First Call

Use the code examples below. Each decision is written to your signed, hash-chained audit trail.

02

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.

HTTP Headers
Authorization: Bearer YOUR_STREETMP_API_KEY
03

POST /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.

ParameterTypeRequiredDescription
modelstring✓An OpenAI (gpt-*, o*) or Anthropic (claude-*) model ID, e.g. gpt-4o-mini
messagesarray✓OpenAI-format messages. Detected PII is tokenised before the request is sent to the provider.
temperaturenumber✗Passed to the provider
max_tokensnumber✗Passed to the provider
04

Node.js Example

Using the native fetch API (Node.js ≥18). No SDK required.

JavaScript / TypeScript
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
}
05

Python Example

Using the requests library (pip install requests).

Python 3.8+
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_approval
06

Screening: 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.

Shell
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" }]
  }'
07

Verdicts

Every screened request gets one verdict. The chat endpoint returns the standard OpenAI response when the request is allowed or sanitised.

JSON
// Example response from POST /v1/guard (values are illustrative)
{
  "verdict":      "SANITIZE",
  "reason_codes": ["PII_DETECTED"],
  "execution_id": "3f6c1e2a-..."
}
ALLOW · SANITIZE

ALLOW: the request proceeds unchanged. SANITIZE: sensitive values are tokenised before the request proceeds.

REVIEW · REQUIRE_APPROVAL · BLOCK

REVIEW and REQUIRE_APPROVAL hold the request for an approver. BLOCK stops it. None of these reach the provider.

UNAVAILABLE · ERROR

A required detector is down or failed. The request is refused rather than passed through (fail-closed).

08

Error Codes

Errors use the OpenAI shape: { error: { message, type, code } }. Responses for stopped requests also include the execution_id and the decision.

JSON — Error
// 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 CodeHTTPDescription
security_blocked403Verdict BLOCK. The request was not sent to the provider.
requires_review403Verdict REVIEW. The request is held for an approver in the dashboard.
requires_approval403Verdict REQUIRE_APPROVAL. The request is held until an approver releases it.
detector_unavailable503Verdict UNAVAILABLE. A required detector is down, so the request is refused rather than passed through.
detector_error503Verdict ERROR. A required detector failed, so the request is refused rather than passed through.
missing_api_key401No StreetMP API key was sent in the Authorization header.
invalid_api_key401API key invalid or revoked.
quota_exceeded429Monthly request allowance for your plan reached. Upgrade or wait for the next billing month.
audit_unavailable503The decision could not be written to the audit trail, so the request was not forwarded.
execution_failed502The call to your AI provider failed.
internal_error500Unexpected internal error. Include the execution_id in any support request.
09

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🇸🇬 Singapore

Singapore NRIC numbers are detected and tokenised before the request is sent to the provider.

MyKad🇲🇾 Malaysia

Malaysian MyKad numbers are detected and tokenised before the request is sent to the provider.

Aadhaar / PAN🇮🇳 India

Aadhaar and PAN numbers are detected and tokenised before the request is sent to the provider.

Health IDsUK · US · AU

NHS numbers, US NPI and MBI, and Australian Medicare numbers are detected.

10

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.

PlanPriceRequests / monthTerms
StarterFree500Monthly
Growth$49 / month50,000Monthly
ScaleFrom $299 / monthBy contractBy contract

Ready to build?

Create your account, add your provider key, generate a StreetMP API key and make your first screened AI request.

© 2026 Street MP Research Forum (CIN: U85499AP2024NPL114932)