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

# 文本生成模型

> 通过文本提示词生成 3D 模型。支持控制模型数量、网格质量、目标面数以及是否仅生成网格。未传新参数时保持原有默认行为。



## OpenAPI

````yaml /openapi.old.zh.json post /api/generateModelWithText
openapi: 3.0.3
info:
  title: Neural4D 管理接口
  description: Neural4D 管理接口规范，中文界面下使用本规范展示中文接口说明。
  version: 1.5.4
servers:
  - url: https://alb.neural4d.com:3000
    description: 生产环境
security:
  - bearerAuth: []
tags:
  - name: text-to-3d
    description: 用于通过文本生成 3D 模型的接口。
    x-group: 文本生成 3D
  - name: image-to-3d
    description: 用于通过图片生成 3D 模型的接口。
    x-group: 图片生成 3D
  - name: model-management
    description: 用于查询模型、跟踪任务和转换格式的接口。
    x-group: 模型管理
  - name: media-generation
    description: 用于生成图片、视频以及查询结果的接口。
    x-group: 图片与视频生成
  - name: account-and-validation
    description: 用于校验输入图片和查询点数余额的接口。
    x-group: 账户与校验
paths:
  /api/generateModelWithText:
    post:
      tags:
        - text-to-3d
      summary: 文本生成模型
      description: 通过文本提示词生成 3D 模型。支持控制模型数量、网格质量、目标面数以及是否仅生成网格。未传新参数时保持原有默认行为。
      operationId: generateModelWithText
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateModelWithTextRequest'
            examples:
              default:
                value:
                  prompt: people
                  modelCount: 1
                  disablePbr: 0
                  onlyGenerateMesh: false
                  mesh_quality: high
                  faceNum: 1000000
      responses:
        '200':
          description: 生成任务已接受，或请求未通过内容审核。
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/GenerateModelWithTextResponse'
                  - $ref: '#/components/schemas/GenerationModerationResponse'
              examples:
                generating:
                  value:
                    type: sys
                    message: Generating
                    uuids:
                      - f47ac10b-58cc-4372-a567-0e02b2c3d479
                    generationConfig:
                      faceNum:
                        default: 1000000
                        min: 500000
                        max: 1000000
                        value: 1000000
                    uploadedImageUrl: null
                moderated:
                  value:
                    limitType: 3
                    message: Please check the prompt.
        '400':
          description: 请求参数无效。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiValidationErrorResponse'
              example:
                errors:
                  - type: field
                    value: 5
                    msg: modelCount must be an integer between 1 and 4 (inclusive)
                    path: modelCount
                    location: body
        '401':
          description: 身份认证失败。
          content:
            text/plain:
              schema:
                type: string
              example: Unauthorized
        '402':
          description: 账户、IP 或点数限制阻止了本次请求。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
              example:
                message: Insufficient points or account restricted
        '403':
          description: 当前账户无权执行本次生成。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
              example:
                message: Generation is not available for the current account
        '429':
          description: 请求频率超过限制。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
              example:
                message: >-
                  Too many requests from this user, please try again after a
                  minute.
        '500':
          description: 生成服务或内部服务不可用。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
              example:
                error: Internal server error
components:
  schemas:
    GenerateModelWithTextRequest:
      type: object
      required:
        - prompt
      properties:
        prompt:
          type: string
          description: 用于生成 3D 模型的文本提示词。
          example: people
          minLength: 1
        modelCount:
          type: integer
          minimum: 1
          default: 4
          description: 生成模型的数量。
          maximum: 4
        disablePbr:
          type: integer
          enum:
            - 0
            - 1
          default: 0
          description: PBR 开关。使用 `0` 开启 PBR，使用 `1` 关闭 PBR。
        onlyGenerateMesh:
          type: boolean
          default: false
          description: 是否仅生成网格，不生成纹理或 PBR 输出。
        mesh_quality:
          type: string
          enum:
            - standard
            - high
            - extra_high
          default: high
          description: 网格质量等级。支持 standard、high 和 extra_high。
        faceNum:
          type: integer
          minimum: 100000
          maximum: 1000000
          description: >-
            目标面数。standard 支持 100000 到 500000，默认 500000；high 和 extra_high 支持
            500000 到 1000000，默认 1000000。
      oneOf:
        - required:
            - mesh_quality
          properties:
            mesh_quality:
              type: string
              enum:
                - standard
              description: standard 网格质量。
            faceNum:
              type: integer
              minimum: 100000
              maximum: 500000
              description: standard 质量对应的目标面数。
        - properties:
            mesh_quality:
              type: string
              enum:
                - high
                - extra_high
              description: high、extra_high 或省略时采用的网格质量。
            faceNum:
              type: integer
              minimum: 500000
              maximum: 1000000
              description: high、extra_high 或默认质量对应的目标面数。
    GenerateModelWithTextResponse:
      type: object
      required:
        - type
        - message
        - uuids
        - uploadedImageUrl
      properties:
        type:
          type: string
          description: 响应来源或类型标记。
          example: sys
          enum:
            - sys
        message:
          type: string
          description: 生成状态消息。
          example: Generating
          enum:
            - Generating
        uuids:
          type: array
          description: 可在后续查询模型时使用的 UUID 列表。
          items:
            type: string
            format: uuid
          minItems: 1
          maxItems: 4
        pointsDeducted:
          type: integer
          nullable: true
          description: 可用时返回本次请求扣除的点数。
        generationConfig:
          allOf:
            - $ref: '#/components/schemas/GenerationConfig'
          nullable: true
          description: 本次生成请求实际采用的标准化面数配置。
        uploadedImageUrl:
          type: string
          format: uri
          nullable: true
          description: 纯文本生成时始终为 null。
    GenerationModerationResponse:
      type: object
      required:
        - limitType
        - message
      properties:
        limitType:
          type: integer
          enum:
            - 3
            - 4
          description: 内容审核结果代码。
        message:
          type: string
          description: 内容审核提示信息。
    ApiValidationErrorResponse:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ApiValidationErrorItem'
          description: 请求参数校验错误列表。
    ApiErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: 可读的 API 错误信息。
        error:
          type: string
          description: 可用时返回内部或下游错误说明。
    GenerationConfig:
      type: object
      required:
        - faceNum
      properties:
        faceNum:
          $ref: '#/components/schemas/GenerationFaceNumConfig'
          description: 生成任务的面数限制及实际采用的标准化值。
    ApiValidationErrorItem:
      type: object
      required:
        - msg
        - path
        - location
      properties:
        type:
          type: string
          description: 校验错误类别。
        value:
          nullable: true
          description: 可用时返回被拒绝的请求值。
        msg:
          type: string
          description: 可读的参数校验错误信息。
        path:
          type: string
          description: 未通过校验的请求字段。
        location:
          type: string
          description: 无效字段所在的请求位置。
    GenerationFaceNumConfig:
      type: object
      required:
        - default
        - min
        - max
        - value
      properties:
        default:
          type: integer
          description: 所选网格质量对应的默认面数。
        min:
          type: integer
          description: 所选网格质量允许的最小面数。
        max:
          type: integer
          description: 所选网格质量允许的最大面数。
        value:
          type: integer
          description: 生成任务实际采用的标准化面数。
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 使用 Neural4D 网站提供的 Bearer token。
      x-default: YOUR_TOKEN

````