> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pmock.com/llms.txt
> Use this file to discover all available pages before exploring further.

# chat responses

> chat responses

## Maven

```xml theme={null}
<dependency>
    <groupId>com.openai</groupId>
    <artifactId>openai-java</artifactId>
    <version>x.x.x</version>
</dependency>
```

## Normal Request Example

<Tabs>
  <Tab title="Java">
    ```java theme={null}
    @Test
    void chatV1ResponsesClientTest() {
        OpenAIClient client = OpenAIOkHttpClient.builder()
                .apiKey(apiKey) // Your access key
                .baseUrl("https://ai.pmock.com/api/ai/chat")
                .build();

        ResponseCreateParams build = ResponseCreateParams.builder()
                .model("gpt-5.2")
                .instructions("You are a helpful assistant.")
                .input("Hello!")
                .build();

        com.openai.models.responses.Response response = client.responses().create(build);
        System.out.println(response.output().get(0).message().get().content().get(0).outputText());
    }
    ```
  </Tab>
</Tabs>

## Stream Response

<Tabs>
  <Tab title="Java">
    ```java theme={null}
    @Test
    void streamChatV1ResponsesClientTest() {
        OpenAIClient client = OpenAIOkHttpClient.builder()
                .apiKey(apiKey) // Your access key
                .baseUrl("https://ai.pmock.com/api/ai/chat")
                .build();

        ResponseCreateParams build = ResponseCreateParams.builder()
                .model("gpt-5.2")
                .instructions("You are a helpful assistant.")
                .input("Hello!")
                .build();

        try (StreamResponse<ResponseStreamEvent> streaming = client.responses().createStreaming(build)) {
            streaming.stream().forEach(chunk -> {
                chunk.outputTextDelta().ifPresent(event -> {
                    String delta = event.delta();
                    System.out.print(delta);
                });
            });
        }
    }
    ```
  </Tab>
</Tabs>


## OpenAPI

````yaml post /ai/chat/responses
openapi: 3.1.0
info:
  title: OpenAPI definition
  version: v0
servers:
  - url: https://ai.pmock.com/api
    description: Generated server url
security: []
tags:
  - name: 开放-百度视频生成
    description: 开放-百度视频生成
  - name: 开放-Grok开放接口
    description: 开放-Grok开放接口
  - name: 开放-Gemini开放接口
    description: 开放-Gemini开放接口
  - name: 开放-AI对话开放接口
    description: 开放-AI对话开放接口
  - name: 开放-Sora2开放接口
    description: 开放-Sora2开放接口
  - name: 开放-模型列表接口
    description: 开放-模型列表接口
  - name: 开放-OpenAi开放接口
    description: 开放-OpenAi开放接口
  - name: 开放-业务相关接口
    description: 开放-业务相关接口
  - name: 开放-任务开放接口
    description: 开放-任务开放接口
paths:
  /ai/chat/responses:
    post:
      tags:
        - 开放-AI对话开放接口
      summary: chat responses
      description: chat responses
      operationId: chatResponses
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatV1ResponsesDTO'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: object
components:
  schemas:
    ChatV1ResponsesDTO:
      type: object
      properties:
        model:
          type: string
          description: >-
            model, You can view the list of supported models through the
            interface `/ai/chat/models`
          enum:
            - gpt-5.4
            - gpt-5.5
            - claude-opus-4-6
            - claude-opus-4-7
            - claude-opus-4-8
        input:
          description: input messages
        instructions:
          type: string
          description: instructions
        stream:
          type: boolean
          default: false
          description: streaming output
        temperature:
          type: number
          format: double
          description: Temperature (0-2)
        maxOutputTokens:
          type: integer
          format: int32
          description: Maximum token count
        topP:
          type: number
          format: double
          description: top P
        tools:
          type: array
          description: Tool List (Function Calling)
          items: {}
        toolChoice:
          description: Tool selection strategy
        text:
          description: Text
      required:
        - input
        - model

````