AdmissibleAI

OpenAI Quickstart

Run a short OpenAI example against the Admissible API using your Sandbox API key. The example shows one allowed action, one denied action, and the runtime decision that explains the difference.

Run a short OpenAI tool-calling example against the Admissible API and see one allowed action, one denied action, and the runtime decision that explains the difference.

Ready to integrate this into a real app? Read the full docs.

Prerequisites

  • Node.js 18 or later and npm
  • Admissible API URL
  • ADMISSIBLE_API_KEY
  • OPENAI_API_KEY

Need an API key? Create a Sandbox account.

Quickstart

  1. Create a project directory and install dependencies

    Note: The OpenAI adapter package currently publishes under the @baseline-labs npm namespace. It is the official OpenAI adapter package for using Admissible AI.

    Command

    mkdir admissible-openai-quickstartcd admissible-openai-quickstartnpm init -ynpm install @baseline-labs/adapter-openai openai tsx
  2. Set the required environment variables

    Command

    export ADMISSIBLE_BASE_URL="https://api.admissible.io"export ADMISSIBLE_API_KEY="your-admissible-api-key"export OPENAI_API_KEY="your-openai-api-key"
  3. Run the example

    Command

    npx tsx openai-sandbox-quickstart.ts

What this run does

This example sends a normal OpenAI tool-calling flow through Admissible so you can see how Admissible evaluates tool actions before they run.

  • The script wraps a short OpenAI tool flow with @baseline-labs/adapter-openai.
  • The first action is an allowed read-only tool call. The second is an irreversible production-style change.
  • Admissible allows the read, blocks the irreversible action, and returns decision details in the same flow.

OpenAI integration surface

const client = createBaselineOpenAI({ baseline, openai, agentId, sessionId });const tool = defineBaselineTool({  name: "read.file",  authority: authorityPresets.readOnly,  execute: async () => ({ contents: "Admissible quickstart example" }),});await client.responses.create({ model: "gpt-4.1", input: "...", tools: [tool] });

What you should see

A successful first run should make the allowed path and the runtime decision easy to spot.

  • one allowed read-only action
  • one denied irreversible action at the runtime boundary
  • adapter-visible tool execution history
  • machine-readable decision fields such as code and reason
  • a Sandbox usage summary before and after the run