v1

Quickstart Guide

Start guarding generative AI prompts in 5 minutes. Point your OpenAI SDK at the EngineNear gateway by changing the base URL or call /v1/guard directly.

Overview

EngineNear provides two primary integration modes for backend services and client applications:

1. Drop-in OpenAI Proxy: Change the baseURL in your existing OpenAI SDK client to http://localhost:3000/v1. Every chat completion request is inspected, scrubbed of secrets/PII, and evaluated against corporate policies before upstream transmission.

2. Direct Inspection API: Call POST /v1/guard directly from your microservice, agent runtime, or pipeline to receive structured findings, tokenized prompts, and policy verdicts.

Zero Raw Prompt Storage
EngineNear never writes raw prompts or completions to disk or databases. The gateway processes payloads in memory and logs only cryptographic SHA-256 hashes.

Point an OpenAI-Compatible Client at the Gateway

By redirecting your OpenAI client’s base URL to the EngineNear gateway, all prompts sent through client.chat.completions.create() pass through the real-time firewall with zero client refactoring.

If a sensitive credential or prompt injection attempt is detected and your active policy is set to Enforce, the gateway intercepts the request and returns an HTTP 403 policy violation.

Chat Completion via EngineNear Proxy
Terminal (curl)
curl -s -X POST http://localhost:3000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer test-token" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {"role": "user", "content": "Draft an executive summary for our Q4 revenue review."}
    ]
  }'

Call the Direct /v1/guard Firewall Endpoint

Use POST /v1/guard when you want discrete control over prompt inspection in your data processing pipelines, custom agents, or pre-prompt validation hooks.

The response includes the policy action verdict (allow, warn, mask, block), a list of fine-grained rule findings, and the sanitized tokenizedPrompt.

Evaluate Prompt with POST /v1/guard
Terminal (curl)
curl -s -X POST http://localhost:3000/v1/guard \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer test-token" \
  -d '{
    "prompt": "Draft an email thanking the team for the Q3 release.",
    "maskSecrets": true
  }'

Next Steps & Verification

Explore the rest of the documentation to configure advanced policies, understand the degradation ladder, and connect internal CRM/knowledge repositories:

  • Concepts: Learn how the T0, T1, and T2 tiers operate and how fail-closed ladders protect against outages.
  • Guides: Detailed walkthroughs for Guard, Analyze, Compile, and Proxy APIs.
  • Errors & Limits: Complete reference on token-bucket rate limits and 503 Retry-After load shedding.
  • API Reference: Interactive OpenAPI specification with request schemas and status codes.