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

# Create completion

> Legacy text completion on the OpenRouter-compatible /api/v1 base.


## OpenAPI

```yaml openapi.json post /api/v1/completions
openapi: 3.1.0
info:
  title: Ocean One API
  version: 2.3.1
servers:
  - url: https://api.plungeai.com
paths:
  /api/v1/completions:
    post:
      operationId: post-api-v1-completions
      tags:
        - Compat
      summary: "Legacy text completion (proxied to inference-gateway): a chat completion with one user message, answered as text_completion."
      security:
        - ozkBearer: []
        - skOcean: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - prompt
              properties:
                model:
                  type: string
                  example: openai/gpt-4o-mini
                prompt:
                  type: string
                  example: Say hi in three words
                  description: One string; arrays answer 400 unsupported_parameter.
                max_tokens:
                  type: integer
                  example: 16
                stream:
                  type: boolean
              additionalProperties: true
      responses:
        "200":
          description: Text completion
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  object:
                    type: string
                    enum:
                      - text_completion
                  choices:
                    type: array
                    items:
                      type: object
                  usage:
                    type: object
        "400":
          description: invalid_json — body is not valid JSON; unsupported_parameter — prompt must be a single string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CompatError"
        "401":
          description: Missing/invalid key
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CompatError"
        "404":
          description: model_not_found — no such model in the catalog
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CompatError"
        "405":
          description: "method_not_allowed — the path serves one method: the Allow header names it, plus OPTIONS"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CompatError"
          headers:
            Allow:
              description: The method this path serves, plus OPTIONS
              schema:
                type: string
components:
  schemas:
    CompatError:
      type: object
      description: "OpenRouter's error envelope, worn by every /api/v1 error (guide 5.0, 5.7): a numeric `code` equal to the HTTP status, the Ocean detail in `metadata`. No X-Error-Code header."
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
              description: The HTTP status
            message:
              type: string
            metadata:
              type: object
              properties:
                error_type:
                  type: string
                  description: "OpenRouter's error type: authentication, payment_required, rate_limit_exceeded, not_found, invalid_request, …"
                ocean_code:
                  type: string
                  description: The /v1 envelope's string error.code
                ocean_type:
                  type: string
                request_id:
                  type: string
                  description: Equals the x-request-id header
              required:
                - error_type
                - ocean_code
                - request_id
              additionalProperties: true
          required:
            - code
            - message
            - metadata
          additionalProperties: true
      required:
        - error
  securitySchemes:
    ozkBearer:
      type: http
      scheme: bearer
      description: "ozk_ platform API key (Authorization: Bearer ozk_…)"
    skOcean:
      type: http
      scheme: bearer
      description: "Legacy sk-ocean- inference key: still accepted on the money plane until the sk-ocean- sunset; new integrations use the ozk_ key"
```
