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

> ## Agent Instructions
> Public hosts only: console https://omnimux.ai/dashboard · API https://api.omnimux.ai · docs https://docs.omnimux.ai.
> Gateway auth is Authorization: Bearer sk-… on https://api.omnimux.ai/v1 (OpenAI-compatible Chat Completions and related paths).
> Discover pages from /llms.txt; full site dump /llms-full.txt; product skill /skill.md; docs search MCP /mcp. Prefer .md page URLs for Markdown.
> Default docs locale is en; zh mirrors the same relative paths. Do not invent model ids not present on live pricing or the complete API pages.

# 创建帖子

> 创建帖子 — 显式账号来源

所有目标账号必须属于请求来源。幂等命中也校验已存来源与账号集合；不符返回 409。媒体预签名仍依赖 Zernio，不是官方独立上传链路。

`provider` 必填，仅允许 `tiktok_direct` 或 `zernio`，表示操作范围，不能改写已存来源。缺失或未知值返回 400 `invalid-provider`。

使用 OmniMux 用户 access token 和 `New-Api-User`，不是 `sk-` 密钥。同时检查 HTTP 状态和 `success`；部分上游错误仍返回 HTTP 200、`success:false`。


## OpenAPI

````yaml openapi/ops/publishing/create-post.json POST /api/social/v1/posts
openapi: 3.1.0
info:
  title: OmniMux Publishing — Create Post
  version: provider-isolation
servers:
  - url: https://omnimux.ai
security:
  - accessToken: []
    userId: []
paths:
  /api/social/v1/posts:
    post:
      summary: Create Post
      operationId: createPost
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
          description: >-
            Replay must match both source and account set. X-Idempotency-Key is
            also accepted.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                provider:
                  type: string
                  enum:
                    - tiktok_direct
                    - zernio
                  description: >-
                    Required expected source; never changes the stored account
                    or post provider.
                account_ids:
                  type: array
                  minItems: 1
                  items:
                    type: integer
                    format: int64
                  description: >-
                    Owned OmniMux account IDs, all belonging to the requested
                    source. Official publishing supports one account.
                content:
                  type: string
                  description: Caption. Use content, not text.
                publish_now:
                  type: boolean
                  default: true
                scheduled_for:
                  type: string
                  description: Setting this makes publish_now false.
                timezone:
                  type: string
                queued:
                  type: boolean
                  default: false
                media_items:
                  type: array
                  items:
                    type: object
                    properties:
                      url:
                        type: string
                        format: uri
                      type:
                        type: string
                    required:
                      - url
                  description: >-
                    Official TikTok requires media. Existing provider-specific
                    media and scheduling behavior applies.
              required:
                - provider
                - account_ids
            example:
              provider: zernio
              content: Your original post
              account_ids:
                - 123
              publish_now: true
      responses:
        '200':
          description: >-
            Check success before reading data. Generic upstream errors may use
            HTTP 200 with success:false.
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      success:
                        type: boolean
                        enum:
                          - true
                      data:
                        type: object
                        properties:
                          id:
                            type: integer
                            format: int64
                          provider:
                            type: string
                            enum:
                              - tiktok_direct
                              - zernio
                            description: >-
                              Required expected source; never changes the stored
                              account or post provider.
                            example: zernio
                          status:
                            type: string
                          provider_post_id:
                            type: string
                          content_preview:
                            type: string
                          created_at:
                            type: integer
                            format: int64
                          idempotency_key:
                            type: string
                        required:
                          - id
                          - provider
                          - status
                    required:
                      - success
                      - data
                  - type: object
                    properties:
                      success:
                        type: boolean
                        enum:
                          - false
                      message:
                        type: string
                      code:
                        type: string
                    required:
                      - success
                      - message
        '400':
          description: >-
            Missing/unknown provider or invalid request. invalid-provider
            identifies a missing or unknown source.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  message:
                    type: string
                  code:
                    type: string
                required:
                  - success
                  - message
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  message:
                    type: string
                  code:
                    type: string
                required:
                  - success
                  - message
        '402':
          description: >-
            Billing-related rejection where applicable; upstream failures may
            instead be wrapped as success:false.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  message:
                    type: string
                  code:
                    type: string
                required:
                  - success
                  - message
        '403':
          description: Account ownership or access denied.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  message:
                    type: string
                  code:
                    type: string
                required:
                  - success
                  - message
        '404':
          description: Account or post not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  message:
                    type: string
                  code:
                    type: string
                required:
                  - success
                  - message
        '409':
          description: Account, post or idempotency source/account-set mismatch.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  message:
                    type: string
                  code:
                    type: string
                required:
                  - success
                  - message
              example:
                success: false
                code: account-provider-mismatch
                message: account-provider-mismatch
        '503':
          description: Requested provider is disabled or not configured.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  message:
                    type: string
                  code:
                    type: string
                required:
                  - success
                  - message
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --request POST \
              --url "https://omnimux.ai/api/social/v1/posts" \
              --header 'Authorization: Bearer <user-access-token>' \
              --header 'New-Api-User: <user-id>' \
              --header 'Content-Type: application/json' \
              --data '{"provider":"zernio","content":"Your original post","account_ids":[123],"publish_now":true}'
components:
  securitySchemes:
    accessToken:
      type: http
      scheme: bearer
      description: OmniMux user access token, not an sk- API key.
    userId:
      type: apiKey
      in: header
      name: New-Api-User
      description: Current authenticated user ID.

````