> For the complete documentation index, see [llms.txt](https://docs.probe.splx.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.probe.splx.ai/ai-red-teaming/probe/target/index/openai.md).

# OpenAI

## Selecting the Connection Type

Once you have [selected your connection type](/ai-red-teaming/probe/target/add-target/integration-setup.md#selecting-a-connection-type), a configuration tab will appear on the next step, prompting you to input the required connection details.

## Integration Setup

The integration supports two API types:

1. ​**Chat Completions API** - The traditional industry-standard protocol (`/v1/chat/completions`). It operates on a message-based array system and requires manual context management. While robust and widely used, it is now considered a legacy path and may not receive the latest agentic features or reasoning optimizations.
2. **Responses API** - The modern, unified protocol designed to supersede Chat Completions. It offers better performance with reasoning models (like GPT-5), native **agentic loops** for multi-tool calling, lower costs through **improved cache utilization**, and built-in **stateful context** management.

The setup process and requirements for both API Types are defined below.

<figure><img src="/files/7CYaGLqOLoVg3jjaseQY" alt=""><figcaption><p>Figure 1: OpenAI Integration Example - Chat Completions API</p></figcaption></figure>

<figure><img src="/files/y9I1EQmTrZd1c9MjY3go" alt=""><figcaption><p>Figure 2: OpenAI Integration Example - Responses API</p></figcaption></figure>

* **System Prompt** - Your application’s system prompt. It sets the initial instructions or context for the AI model, defines the behavior, tone, and specific guidelines the AI should follow while interacting. For best practices, refer to the [OpenAI documentation on prompt engineering](https://platform.openai.com/docs/guides/prompt-engineering).
* **API Key** - Your OpenAI API key, find the secret API key on the OpenAI Platform's [API key page](https://platform.openai.com/api-keys).
* **Model** - The OpenAI model of your choice, you can get the overview of the models on the [Models page](https://platform.openai.com/docs/models) of OpenAI Platform documentation.

For more information, you can explore the official [OpenAI Platform](https://platform.openai.com/docs/overview) documentation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.probe.splx.ai/ai-red-teaming/probe/target/index/openai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
