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

# Chat completions

> OpenAI-compatible chat completions with NordlysProxy routing.



## OpenAPI

````yaml openapi.yaml post /v1/chat/completions
openapi: 3.0.3
info:
  description: OpenAPI documentation for Fiber applications
  title: NordlysProxy Inference API
  version: 1.0.0
servers: []
security: []
paths:
  /v1/chat/completions:
    post:
      summary: Chat completions
      description: OpenAI-compatible chat completions with NordlysProxy routing.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompletionsChatCompletionRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ChatCompletion'
          description: OK
      security:
        - apiKey: []
components:
  schemas:
    CompletionsChatCompletionRequest:
      properties:
        audio:
          $ref: '#/components/schemas/V2ChatCompletionAudioParam'
        frequency_penalty:
          $ref: '#/components/schemas/ParamOptFloat64'
        logit_bias:
          additionalProperties:
            format: int64
            type: integer
          nullable: true
          type: object
        logprobs:
          $ref: '#/components/schemas/ParamOptBool'
        max_completion_tokens:
          $ref: '#/components/schemas/ParamOptInt64'
        max_tokens:
          $ref: '#/components/schemas/ParamOptInt64'
        messages:
          example:
            - content: Explain nordlys routing.
              role: user
          items:
            $ref: '#/components/schemas/V2ChatCompletionMessageParamUnion'
          nullable: true
          type: array
        metadata:
          $ref: '#/components/schemas/SharedMetadata'
        modalities:
          items:
            type: string
          nullable: true
          type: array
        model:
          example: claude-opus-4-5
          type: string
        models:
          items:
            type: string
          nullable: true
          type: array
        'n':
          $ref: '#/components/schemas/ParamOptInt64'
        parallel_tool_calls:
          $ref: '#/components/schemas/ParamOptBool'
        prediction:
          $ref: '#/components/schemas/V2ChatCompletionPredictionContentParam'
        presence_penalty:
          $ref: '#/components/schemas/ParamOptFloat64'
        provider_configs:
          additionalProperties:
            $ref: '#/components/schemas/RegistryProviderConfigOverride'
          nullable: true
          type: object
        provider_data_collection:
          type: string
        provider_enforce_distillable_text:
          nullable: true
          type: boolean
        provider_ignore:
          items:
            type: string
          nullable: true
          type: array
        provider_max_completion_price:
          nullable: true
          type: number
        provider_max_image_price:
          nullable: true
          type: number
        provider_max_prompt_price:
          nullable: true
          type: number
        provider_max_request_price:
          nullable: true
          type: number
        provider_only:
          items:
            type: string
          nullable: true
          type: array
        provider_order:
          items:
            type: string
          nullable: true
          type: array
        provider_quantizations:
          items:
            type: string
          nullable: true
          type: array
        provider_require_parameters:
          type: boolean
        provider_sort:
          type: string
        provider_zdr:
          nullable: true
          type: boolean
        reasoning_effort:
          type: string
        response_format:
          $ref: '#/components/schemas/V2ChatCompletionNewParamsResponseFormatUnion'
        seed:
          $ref: '#/components/schemas/ParamOptInt64'
        service_tier:
          type: string
        stop:
          $ref: '#/components/schemas/V2ChatCompletionNewParamsStopUnion'
        store:
          $ref: '#/components/schemas/ParamOptBool'
        stream:
          example: false
          type: boolean
        stream_options:
          $ref: '#/components/schemas/V2ChatCompletionStreamOptionsParam'
        temperature:
          $ref: '#/components/schemas/ParamOptFloat64'
        tool_choice:
          $ref: '#/components/schemas/V2ChatCompletionToolChoiceOptionUnionParam'
        tools:
          items:
            $ref: '#/components/schemas/V2ChatCompletionToolUnionParam'
          nullable: true
          type: array
        top_logprobs:
          $ref: '#/components/schemas/ParamOptInt64'
        top_p:
          $ref: '#/components/schemas/ParamOptFloat64'
        user:
          $ref: '#/components/schemas/ParamOptString'
        web_search_options:
          $ref: '#/components/schemas/V2ChatCompletionNewParamsWebSearchOptions'
      type: object
    V2ChatCompletion:
      properties:
        choices:
          items:
            $ref: '#/components/schemas/V2ChatCompletionChoice'
          nullable: true
          type: array
        created:
          format: int64
          type: integer
        id:
          type: string
        model:
          type: string
        object:
          type: string
        service_tier:
          type: string
        system_fingerprint:
          type: string
        usage:
          $ref: '#/components/schemas/V2CompletionUsage'
      type: object
    V2ChatCompletionAudioParam:
      properties:
        format:
          type: string
        voice:
          type: string
      type: object
    ParamOptFloat64:
      type: object
    ParamOptBool:
      type: object
    ParamOptInt64:
      type: object
    V2ChatCompletionMessageParamUnion:
      properties:
        OfAssistant:
          $ref: '#/components/schemas/V2ChatCompletionAssistantMessageParam'
        OfDeveloper:
          $ref: '#/components/schemas/V2ChatCompletionDeveloperMessageParam'
        OfFunction:
          $ref: '#/components/schemas/V2ChatCompletionFunctionMessageParam'
        OfSystem:
          $ref: '#/components/schemas/V2ChatCompletionSystemMessageParam'
        OfTool:
          $ref: '#/components/schemas/V2ChatCompletionToolMessageParam'
        OfUser:
          $ref: '#/components/schemas/V2ChatCompletionUserMessageParam'
      type: object
    SharedMetadata:
      additionalProperties:
        type: string
      type: object
    V2ChatCompletionPredictionContentParam:
      properties:
        content:
          $ref: >-
            #/components/schemas/V2ChatCompletionPredictionContentContentUnionParam
        type:
          type: string
      type: object
    RegistryProviderConfigOverride:
      properties:
        api_key:
          nullable: true
          type: string
        base_url:
          nullable: true
          type: string
        endpoint_overrides:
          additionalProperties:
            $ref: '#/components/schemas/RegistryEndpointOverride'
          type: object
      type: object
    V2ChatCompletionNewParamsResponseFormatUnion:
      properties:
        OfJSONObject:
          $ref: '#/components/schemas/SharedResponseFormatJSONObjectParam'
        OfJSONSchema:
          $ref: '#/components/schemas/SharedResponseFormatJSONSchemaParam'
        OfText:
          $ref: '#/components/schemas/SharedResponseFormatTextParam'
      type: object
    V2ChatCompletionNewParamsStopUnion:
      properties:
        OfString:
          $ref: '#/components/schemas/ParamOptString'
        OfStringArray:
          items:
            type: string
          nullable: true
          type: array
      type: object
    V2ChatCompletionStreamOptionsParam:
      properties:
        include_obfuscation:
          $ref: '#/components/schemas/ParamOptBool'
        include_usage:
          $ref: '#/components/schemas/ParamOptBool'
      type: object
    V2ChatCompletionToolChoiceOptionUnionParam:
      properties:
        OfAllowedTools:
          $ref: '#/components/schemas/V2ChatCompletionAllowedToolChoiceParam'
        OfAuto:
          $ref: '#/components/schemas/ParamOptString'
        OfCustomToolChoice:
          $ref: '#/components/schemas/V2ChatCompletionNamedToolChoiceCustomParam'
        OfFunctionToolChoice:
          $ref: '#/components/schemas/V2ChatCompletionNamedToolChoiceParam'
      type: object
    V2ChatCompletionToolUnionParam:
      properties:
        OfCustom:
          $ref: '#/components/schemas/V2ChatCompletionCustomToolParam'
        OfFunction:
          $ref: '#/components/schemas/V2ChatCompletionFunctionToolParam'
      type: object
    ParamOptString:
      type: object
    V2ChatCompletionNewParamsWebSearchOptions:
      properties:
        search_context_size:
          type: string
        user_location:
          $ref: >-
            #/components/schemas/V2ChatCompletionNewParamsWebSearchOptionsUserLocation
      type: object
    V2ChatCompletionChoice:
      properties:
        finish_reason:
          type: string
        index:
          format: int64
          type: integer
        logprobs:
          $ref: '#/components/schemas/V2ChatCompletionChoiceLogprobs'
        message:
          $ref: '#/components/schemas/V2ChatCompletionMessage'
      type: object
    V2CompletionUsage:
      properties:
        completion_tokens:
          format: int64
          type: integer
        completion_tokens_details:
          $ref: '#/components/schemas/V2CompletionUsageCompletionTokensDetails'
        prompt_tokens:
          format: int64
          type: integer
        prompt_tokens_details:
          $ref: '#/components/schemas/V2CompletionUsagePromptTokensDetails'
        total_tokens:
          format: int64
          type: integer
      type: object
    V2ChatCompletionAssistantMessageParam:
      properties:
        audio:
          $ref: '#/components/schemas/V2ChatCompletionAssistantMessageParamAudio'
        content:
          $ref: >-
            #/components/schemas/V2ChatCompletionAssistantMessageParamContentUnion
        function_call:
          $ref: >-
            #/components/schemas/V2ChatCompletionAssistantMessageParamFunctionCall
        name:
          $ref: '#/components/schemas/ParamOptString'
        refusal:
          $ref: '#/components/schemas/ParamOptString'
        role:
          type: string
        tool_calls:
          items:
            $ref: '#/components/schemas/V2ChatCompletionMessageToolCallUnionParam'
          nullable: true
          type: array
      type: object
    V2ChatCompletionDeveloperMessageParam:
      properties:
        content:
          $ref: >-
            #/components/schemas/V2ChatCompletionDeveloperMessageParamContentUnion
        name:
          $ref: '#/components/schemas/ParamOptString'
        role:
          type: string
      type: object
    V2ChatCompletionFunctionMessageParam:
      properties:
        content:
          $ref: '#/components/schemas/ParamOptString'
        name:
          type: string
        role:
          type: string
      type: object
    V2ChatCompletionSystemMessageParam:
      properties:
        content:
          $ref: '#/components/schemas/V2ChatCompletionSystemMessageParamContentUnion'
        name:
          $ref: '#/components/schemas/ParamOptString'
        role:
          type: string
      type: object
    V2ChatCompletionToolMessageParam:
      properties:
        content:
          $ref: '#/components/schemas/V2ChatCompletionToolMessageParamContentUnion'
        role:
          type: string
        tool_call_id:
          type: string
      type: object
    V2ChatCompletionUserMessageParam:
      properties:
        content:
          $ref: '#/components/schemas/V2ChatCompletionUserMessageParamContentUnion'
        name:
          $ref: '#/components/schemas/ParamOptString'
        role:
          type: string
      type: object
    V2ChatCompletionPredictionContentContentUnionParam:
      properties:
        OfArrayOfContentParts:
          items:
            $ref: '#/components/schemas/V2ChatCompletionContentPartTextParam'
          nullable: true
          type: array
        OfString:
          $ref: '#/components/schemas/ParamOptString'
      type: object
    RegistryEndpointOverride:
      properties:
        base_url:
          type: string
        timeout:
          type: integer
      type: object
    SharedResponseFormatJSONObjectParam:
      properties:
        type:
          type: string
      type: object
    SharedResponseFormatJSONSchemaParam:
      properties:
        json_schema:
          $ref: '#/components/schemas/SharedResponseFormatJSONSchemaJSONSchemaParam'
        type:
          type: string
      type: object
    SharedResponseFormatTextParam:
      properties:
        type:
          type: string
      type: object
    V2ChatCompletionAllowedToolChoiceParam:
      properties:
        allowed_tools:
          $ref: '#/components/schemas/V2ChatCompletionAllowedToolsParam'
        type:
          type: string
      type: object
    V2ChatCompletionNamedToolChoiceCustomParam:
      properties:
        custom:
          $ref: >-
            #/components/schemas/V2ChatCompletionNamedToolChoiceCustomCustomParam
        type:
          type: string
      type: object
    V2ChatCompletionNamedToolChoiceParam:
      properties:
        function:
          $ref: '#/components/schemas/V2ChatCompletionNamedToolChoiceFunctionParam'
        type:
          type: string
      type: object
    V2ChatCompletionCustomToolParam:
      properties:
        custom:
          $ref: '#/components/schemas/V2ChatCompletionCustomToolCustomParam'
        type:
          type: string
      type: object
    V2ChatCompletionFunctionToolParam:
      properties:
        function:
          $ref: '#/components/schemas/SharedFunctionDefinitionParam'
        type:
          type: string
      type: object
    V2ChatCompletionNewParamsWebSearchOptionsUserLocation:
      properties:
        approximate:
          $ref: >-
            #/components/schemas/V2ChatCompletionNewParamsWebSearchOptionsUserLocationApproximate
        type:
          type: string
      type: object
    V2ChatCompletionChoiceLogprobs:
      properties:
        content:
          items:
            $ref: '#/components/schemas/V2ChatCompletionTokenLogprob'
          nullable: true
          type: array
        refusal:
          items:
            $ref: '#/components/schemas/V2ChatCompletionTokenLogprob'
          nullable: true
          type: array
      type: object
    V2ChatCompletionMessage:
      properties:
        annotations:
          items:
            $ref: '#/components/schemas/V2ChatCompletionMessageAnnotation'
          nullable: true
          type: array
        audio:
          $ref: '#/components/schemas/V2ChatCompletionAudio'
        content:
          type: string
        function_call:
          $ref: '#/components/schemas/V2ChatCompletionMessageFunctionCall'
        refusal:
          type: string
        role:
          type: string
        tool_calls:
          items:
            $ref: '#/components/schemas/V2ChatCompletionMessageToolCallUnion'
          nullable: true
          type: array
      type: object
    V2CompletionUsageCompletionTokensDetails:
      properties:
        accepted_prediction_tokens:
          format: int64
          type: integer
        audio_tokens:
          format: int64
          type: integer
        reasoning_tokens:
          format: int64
          type: integer
        rejected_prediction_tokens:
          format: int64
          type: integer
      type: object
    V2CompletionUsagePromptTokensDetails:
      properties:
        audio_tokens:
          format: int64
          type: integer
        cached_tokens:
          format: int64
          type: integer
      type: object
    V2ChatCompletionAssistantMessageParamAudio:
      properties:
        id:
          type: string
      type: object
    V2ChatCompletionAssistantMessageParamContentUnion:
      properties:
        OfArrayOfContentParts:
          items:
            $ref: >-
              #/components/schemas/V2ChatCompletionAssistantMessageParamContentArrayOfContentPartUnion
          nullable: true
          type: array
        OfString:
          $ref: '#/components/schemas/ParamOptString'
      type: object
    V2ChatCompletionAssistantMessageParamFunctionCall:
      properties:
        arguments:
          type: string
        name:
          type: string
      type: object
    V2ChatCompletionMessageToolCallUnionParam:
      properties:
        OfCustom:
          $ref: '#/components/schemas/V2ChatCompletionMessageCustomToolCallParam'
        OfFunction:
          $ref: '#/components/schemas/V2ChatCompletionMessageFunctionToolCallParam'
      type: object
    V2ChatCompletionDeveloperMessageParamContentUnion:
      properties:
        OfArrayOfContentParts:
          items:
            $ref: '#/components/schemas/V2ChatCompletionContentPartTextParam'
          nullable: true
          type: array
        OfString:
          $ref: '#/components/schemas/ParamOptString'
      type: object
    V2ChatCompletionSystemMessageParamContentUnion:
      properties:
        OfArrayOfContentParts:
          items:
            $ref: '#/components/schemas/V2ChatCompletionContentPartTextParam'
          nullable: true
          type: array
        OfString:
          $ref: '#/components/schemas/ParamOptString'
      type: object
    V2ChatCompletionToolMessageParamContentUnion:
      properties:
        OfArrayOfContentParts:
          items:
            $ref: '#/components/schemas/V2ChatCompletionContentPartTextParam'
          nullable: true
          type: array
        OfString:
          $ref: '#/components/schemas/ParamOptString'
      type: object
    V2ChatCompletionUserMessageParamContentUnion:
      properties:
        OfArrayOfContentParts:
          items:
            $ref: '#/components/schemas/V2ChatCompletionContentPartUnionParam'
          nullable: true
          type: array
        OfString:
          $ref: '#/components/schemas/ParamOptString'
      type: object
    V2ChatCompletionContentPartTextParam:
      properties:
        text:
          type: string
        type:
          type: string
      type: object
    SharedResponseFormatJSONSchemaJSONSchemaParam:
      properties:
        description:
          $ref: '#/components/schemas/ParamOptString'
        name:
          type: string
        schema: {}
        strict:
          $ref: '#/components/schemas/ParamOptBool'
      type: object
    V2ChatCompletionAllowedToolsParam:
      properties:
        mode:
          type: string
        tools:
          items:
            additionalProperties: {}
            type: object
          nullable: true
          type: array
      type: object
    V2ChatCompletionNamedToolChoiceCustomCustomParam:
      properties:
        name:
          type: string
      type: object
    V2ChatCompletionNamedToolChoiceFunctionParam:
      properties:
        name:
          type: string
      type: object
    V2ChatCompletionCustomToolCustomParam:
      properties:
        description:
          $ref: '#/components/schemas/ParamOptString'
        format:
          $ref: >-
            #/components/schemas/V2ChatCompletionCustomToolCustomFormatUnionParam
        name:
          type: string
      type: object
    SharedFunctionDefinitionParam:
      properties:
        description:
          $ref: '#/components/schemas/ParamOptString'
        name:
          type: string
        parameters:
          $ref: '#/components/schemas/SharedFunctionParameters'
        strict:
          $ref: '#/components/schemas/ParamOptBool'
      type: object
    V2ChatCompletionNewParamsWebSearchOptionsUserLocationApproximate:
      properties:
        city:
          $ref: '#/components/schemas/ParamOptString'
        country:
          $ref: '#/components/schemas/ParamOptString'
        region:
          $ref: '#/components/schemas/ParamOptString'
        timezone:
          $ref: '#/components/schemas/ParamOptString'
      type: object
    V2ChatCompletionTokenLogprob:
      properties:
        bytes:
          items:
            format: int64
            type: integer
          nullable: true
          type: array
        logprob:
          format: double
          type: number
        token:
          type: string
        top_logprobs:
          items:
            $ref: '#/components/schemas/V2ChatCompletionTokenLogprobTopLogprob'
          nullable: true
          type: array
      type: object
    V2ChatCompletionMessageAnnotation:
      properties:
        type:
          type: string
        url_citation:
          $ref: '#/components/schemas/V2ChatCompletionMessageAnnotationURLCitation'
      type: object
    V2ChatCompletionAudio:
      properties:
        data:
          type: string
        expires_at:
          format: int64
          type: integer
        id:
          type: string
        transcript:
          type: string
      type: object
    V2ChatCompletionMessageFunctionCall:
      properties:
        arguments:
          type: string
        name:
          type: string
      type: object
    V2ChatCompletionMessageToolCallUnion:
      properties:
        custom:
          $ref: '#/components/schemas/V2ChatCompletionMessageCustomToolCallCustom'
        function:
          $ref: '#/components/schemas/V2ChatCompletionMessageFunctionToolCallFunction'
        id:
          type: string
        type:
          type: string
      type: object
    V2ChatCompletionAssistantMessageParamContentArrayOfContentPartUnion:
      properties:
        OfRefusal:
          $ref: '#/components/schemas/V2ChatCompletionContentPartRefusalParam'
        OfText:
          $ref: '#/components/schemas/V2ChatCompletionContentPartTextParam'
      type: object
    V2ChatCompletionMessageCustomToolCallParam:
      properties:
        custom:
          $ref: >-
            #/components/schemas/V2ChatCompletionMessageCustomToolCallCustomParam
        id:
          type: string
        type:
          type: string
      type: object
    V2ChatCompletionMessageFunctionToolCallParam:
      properties:
        function:
          $ref: >-
            #/components/schemas/V2ChatCompletionMessageFunctionToolCallFunctionParam
        id:
          type: string
        type:
          type: string
      type: object
    V2ChatCompletionContentPartUnionParam:
      properties:
        OfFile:
          $ref: '#/components/schemas/V2ChatCompletionContentPartFileParam'
        OfImageURL:
          $ref: '#/components/schemas/V2ChatCompletionContentPartImageParam'
        OfInputAudio:
          $ref: '#/components/schemas/V2ChatCompletionContentPartInputAudioParam'
        OfText:
          $ref: '#/components/schemas/V2ChatCompletionContentPartTextParam'
      type: object
    V2ChatCompletionCustomToolCustomFormatUnionParam:
      properties:
        OfGrammar:
          $ref: >-
            #/components/schemas/V2ChatCompletionCustomToolCustomFormatGrammarParam
        OfText:
          $ref: '#/components/schemas/V2ChatCompletionCustomToolCustomFormatTextParam'
      type: object
    SharedFunctionParameters:
      additionalProperties: {}
      type: object
    V2ChatCompletionTokenLogprobTopLogprob:
      properties:
        bytes:
          items:
            format: int64
            type: integer
          nullable: true
          type: array
        logprob:
          format: double
          type: number
        token:
          type: string
      type: object
    V2ChatCompletionMessageAnnotationURLCitation:
      properties:
        end_index:
          format: int64
          type: integer
        start_index:
          format: int64
          type: integer
        title:
          type: string
        url:
          type: string
      type: object
    V2ChatCompletionMessageCustomToolCallCustom:
      properties:
        input:
          type: string
        name:
          type: string
      type: object
    V2ChatCompletionMessageFunctionToolCallFunction:
      properties:
        arguments:
          type: string
        name:
          type: string
      type: object
    V2ChatCompletionContentPartRefusalParam:
      properties:
        refusal:
          type: string
        type:
          type: string
      type: object
    V2ChatCompletionMessageCustomToolCallCustomParam:
      properties:
        input:
          type: string
        name:
          type: string
      type: object
    V2ChatCompletionMessageFunctionToolCallFunctionParam:
      properties:
        arguments:
          type: string
        name:
          type: string
      type: object
    V2ChatCompletionContentPartFileParam:
      properties:
        file:
          $ref: '#/components/schemas/V2ChatCompletionContentPartFileFileParam'
        type:
          type: string
      type: object
    V2ChatCompletionContentPartImageParam:
      properties:
        image_url:
          $ref: '#/components/schemas/V2ChatCompletionContentPartImageImageURLParam'
        type:
          type: string
      type: object
    V2ChatCompletionContentPartInputAudioParam:
      properties:
        input_audio:
          $ref: >-
            #/components/schemas/V2ChatCompletionContentPartInputAudioInputAudioParam
        type:
          type: string
      type: object
    V2ChatCompletionCustomToolCustomFormatGrammarParam:
      properties:
        grammar:
          $ref: >-
            #/components/schemas/V2ChatCompletionCustomToolCustomFormatGrammarGrammarParam
        type:
          type: string
      type: object
    V2ChatCompletionCustomToolCustomFormatTextParam:
      properties:
        type:
          type: string
      type: object
    V2ChatCompletionContentPartFileFileParam:
      properties:
        file_data:
          $ref: '#/components/schemas/ParamOptString'
        file_id:
          $ref: '#/components/schemas/ParamOptString'
        filename:
          $ref: '#/components/schemas/ParamOptString'
      type: object
    V2ChatCompletionContentPartImageImageURLParam:
      properties:
        detail:
          type: string
        url:
          format: uri
          type: string
      type: object
    V2ChatCompletionContentPartInputAudioInputAudioParam:
      properties:
        data:
          type: string
        format:
          type: string
      type: object
    V2ChatCompletionCustomToolCustomFormatGrammarGrammarParam:
      properties:
        definition:
          type: string
        syntax:
          type: string
      type: object
  securitySchemes:
    apiKey:
      in: header
      name: X-API-Key
      type: apiKey

````