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

# Create a chat completion

> Answer a conversation with an open chat model such as Qwen3 or Gemma 4, as one JSON reply or as server-sent events.

Answers a conversation with one of the [chat models](https://docs.sharemy.ai/models.md#chat). The reply comes back whole, or as server-sent events with `"stream": true`.

## Price

The price uses the output token budget. Send a positive integer in `max_completion_tokens` or `max_tokens`. If you send both, `max_completion_tokens` wins. The model default is 1,024 or 2,048. Values above 4,096 are capped at 4,096 for generation and pricing. When capped, the response includes `X-ShareMyAI-Max-Tokens: 4096`. See [Credits and pricing](https://docs.sharemy.ai/credits-and-pricing.md#chat).

## Thinking

The Qwen3 and Gemma 4 models can think before they answer. Thinking is off unless you send `reasoning_effort`:

* Leave it out, or send `none` or `minimal`: the model answers without thinking.
* Send another nonempty string, such as `low`, `medium` or `high`: the model thinks first. The level itself makes no difference.

`smollm2-360m` never thinks and ignores the field. Thinking uses tokens from `max_tokens`, so allow enough for both.

Without streaming, the thinking comes back in `message.reasoning_content`, apart from the answer in `message.content`:

```json theme={null}
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1764900000,
  "model": "qwen3-4b",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "391",
      "reasoning_content": "17 times 23: 17 times 20 is 340, plus 17 times 3 is 51..."
    },
    "finish_reason": "stop"
  }],
  "usage": { "prompt_tokens": 5, "completion_tokens": 54, "total_tokens": 59, "cost_credits": 4.096 }
}
```

With streaming, the thinking is held until it is finished, then sent whole in one chunk as `delta.reasoning_content`, before the answer streams in `delta.content`.

```python Python theme={null}
completion = client.chat.completions.create(
    model="qwen3-4b",
    messages=[{"role": "user", "content": "What is 17 times 23?"}],
    reasoning_effort="medium",
    max_tokens=1024,
)
message = completion.choices[0].message
print(getattr(message, "reasoning_content", None))
print(message.content)
```

```javascript Node theme={null}
const completion = await client.chat.completions.create({
  model: "qwen3-4b",
  messages: [{ role: "user", content: "What is 17 times 23?" }],
  reasoning_effort: "medium",
  max_tokens: 1024,
});
const message = completion.choices[0].message;
console.log(message.reasoning_content);
console.log(message.content);
```

## Streaming

An accepted request with `stream: true` opens a `text/event-stream` response. The first content or reasoning chunk carries the assistant role. Ignore the `: waiting` keepalive comments sent every 15 seconds while the stream is open.

On success, the final choice has an empty `delta` and a `finish_reason` of `stop` or `length`. Set `stream_options.include_usage` to `true` to receive one more chunk with `choices: []` and the full `usage` before `data: [DONE]`.

```bash curl theme={null}
curl -N https://sharemy.ai/v1/chat/completions \
  -H "Authorization: Bearer $SHAREMYAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "qwen3-4b", "stream": true, "max_tokens": 512,
       "messages": [{"role": "user", "content": "Tell me a short story."}]}'
```

```python Python theme={null}
stream = client.chat.completions.create(
    model="qwen3-4b",
    messages=[{"role": "user", "content": "Tell me a short story."}],
    max_tokens=512,
    stream=True,
)
for chunk in stream:
    if chunk.choices:
        print(chunk.choices[0].delta.content or "", end="", flush=True)
```

```javascript Node theme={null}
const stream = await client.chat.completions.create({
  model: "qwen3-4b",
  messages: [{ role: "user", content: "Tell me a short story." }],
  max_tokens: 512,
  stream: true,
});
for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}
```

A refusal at submission returns an HTTP error and a JSON body, even with `stream: true`. A failure after acceptance sends one error event and closes the stream. If a machine leaves mid-reply, the stream ends with `network_error` and the job is refunded. See [Errors in a stream](https://docs.sharemy.ai/errors-and-limits.md#errors-in-a-stream).

## Request fields

* **Messages.** Use `system`, `developer`, `user` or `assistant`. A `developer` message becomes a system message. Send content as a string or an array of text parts.
* **Defaults.** Top-level `null` values behave like omitted fields. Both `model` and `messages` are required.
* **Stop strings.** Send `stop` as a string or a list of strings. The returned answer ends before the first matching string, including when streamed.
* **One reply.** Omit `n` or set it to `1`. A value above 1 gets `400 unsupported_value`.
* **Output format.** Use text. Requesting `json_object` or `json_schema` in `response_format` gets `400 unsupported_value`.
* **Tools.** Omit `tool_choice` or send `auto` or `none`. A required or named tool choice gets `400 unsupported_value`. The model does not call tools.
* **Ignored fields.** `tools`, `seed`, `logprobs`, `presence_penalty`, `frequency_penalty`, `logit_bias` and `user`.

## Finish reason and usage

For both response formats, `finish_reason` is `length` when the model reports reaching the output budget or ends with unfinished thinking. Otherwise it is `stop`.

`usage.prompt_tokens` estimates one token per four characters, rounded up. `completion_tokens` uses the model's count when available and otherwise uses the same estimate. `usage.cost_credits` is the price in credits.


## OpenAPI

````yaml api-reference/openapi.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: ShareMyAI API
  version: 1.0.0
  description: >-
    OpenAI-shaped endpoints that run jobs on shared GPUs. Closing the connection
    cancels an unfinished synchronous job and returns its held credits. CORS
    allows any origin, echoes requested preflight headers and exposes Location,
    the request id, concurrency, retry, cost, balance, token cap and sample rate
    headers.
servers:
  - url: https://sharemy.ai
    description: ShareMyAI
security:
  - bearerAuth: []
tags:
  - name: Models
  - name: Chat
  - name: Images
  - name: Jobs
  - name: Audio
paths:
  /v1/chat/completions:
    post:
      tags:
        - Chat
      summary: Create a chat completion
      description: >-
        Answer a conversation with one of the chat models, as one JSON reply or
        as a stream of server-sent events.
      operationId: createChatCompletion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatRequest'
            example:
              model: qwen3-4b
              messages:
                - role: system
                  content: Answer in one sentence.
                - role: user
                  content: Why is the sky blue?
              max_tokens: 256
      responses:
        '200':
          description: >-
            One completion or an accepted SSE stream. A successful stream ends
            with [DONE], preceded by a usage chunk if requested. A later failure
            sends one error event and closes. A refusal before acceptance
            returns an HTTP error with JSON.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletion'
            text/event-stream:
              schema:
                description: >-
                  Payload of a data event. Ignore the : waiting keepalive
                  comments sent every 15 seconds.
                oneOf:
                  - $ref: '#/components/schemas/ChatCompletionChunk'
                  - $ref: '#/components/schemas/StreamError'
                  - type: string
                    const: '[DONE]'
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id'
            x-ratelimit-limit-concurrent:
              $ref: '#/components/headers/x-ratelimit-limit-concurrent'
            x-ratelimit-remaining-concurrent:
              $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
            X-ShareMyAI-Cost-Credits:
              $ref: '#/components/headers/X-ShareMyAI-Cost-Credits'
            X-ShareMyAI-Balance-Credits:
              $ref: '#/components/headers/X-ShareMyAI-Balance-Credits'
            X-ShareMyAI-Max-Tokens:
              $ref: '#/components/headers/X-ShareMyAI-Max-Tokens'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientCredits'
        '403':
          $ref: '#/components/responses/Suspended'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '429':
          $ref: '#/components/responses/TooManyCalls'
        '499':
          $ref: '#/components/responses/Cancelled'
        '502':
          $ref: '#/components/responses/NetworkError'
        '503':
          $ref: '#/components/responses/NoProvider'
      x-codeSamples:
        - lang: bash
          label: curl
          source: |-
            curl https://sharemy.ai/v1/chat/completions \
              -H "Authorization: Bearer $SHAREMYAI_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "model": "qwen3-4b",
                "messages": [{"role": "user", "content": "Why is the sky blue?"}],
                "max_tokens": 256
              }'
        - lang: python
          label: Python
          source: >-
            import os

            from openai import OpenAI


            client = OpenAI(api_key=os.environ["SHAREMYAI_API_KEY"],
            base_url="https://sharemy.ai/v1")


            completion = client.chat.completions.create(
                model="qwen3-4b",
                messages=[{"role": "user", "content": "Why is the sky blue?"}],
                max_tokens=256,
            )

            print(completion.choices[0].message.content)
        - lang: javascript
          label: Node
          source: >-
            import OpenAI from "openai";


            const client = new OpenAI({ apiKey: process.env.SHAREMYAI_API_KEY,
            baseURL: "https://sharemy.ai/v1" });


            const completion = await client.chat.completions.create({
              model: "qwen3-4b",
              messages: [{ role: "user", content: "Why is the sky blue?" }],
              max_tokens: 256,
            });

            console.log(completion.choices[0].message.content);
components:
  schemas:
    ChatRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          enum:
            - smollm2-360m
            - qwen3-06b
            - qwen3-17b
            - qwen3-4b
            - gemma-4-e2b
            - gemma-4-e4b
          description: A chat model id. There is no default.
        messages:
          type: array
          minItems: 1
          maxItems: 100
          description: >-
            1 to 100 messages, with at most 64,000 characters of text across all
            of them.
          items:
            $ref: '#/components/schemas/ChatMessage'
        max_tokens:
          type:
            - integer
            - 'null'
          minimum: 1
          description: >-
            Maximum output tokens used for generation and pricing. Defaults to
            1024 or 2048 by model. Values above 4096 are capped and reported in
            X-ShareMyAI-Max-Tokens.
        max_completion_tokens:
          type:
            - integer
            - 'null'
          minimum: 1
          description: >-
            Same budget and cap as max_tokens. Takes precedence when both are
            supplied.
        temperature:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 2
          default: 0.7
        top_p:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 1
          default: 0.9
        stream:
          type:
            - boolean
            - 'null'
          default: false
          description: Send the reply as server-sent events while it is written.
        reasoning_effort:
          type:
            - string
            - 'null'
          description: >-
            Any nonempty string except none or minimal enables thinking on
            supported models. smollm2-360m ignores it.
          examples:
            - medium
        'n':
          type:
            - integer
            - 'null'
          description: >-
            One completion per request. Values above 1 return 400
            unsupported_value.
          enum:
            - 1
            - null
        stop:
          description: End the returned answer before the first matching nonempty string.
          oneOf:
            - type: string
            - type: array
              items:
                type: string
            - type: 'null'
        response_format:
          description: Use text. json_object and json_schema return 400 unsupported_value.
          oneOf:
            - type: object
              required:
                - type
              properties:
                type:
                  const: text
            - const: text
            - type: 'null'
        tool_choice:
          type:
            - string
            - 'null'
          description: >-
            Required or named choices return 400 unsupported_value. Tool calls
            are unsupported.
          enum:
            - auto
            - none
            - null
        stream_options:
          type:
            - object
            - 'null'
          description: Options for streamed replies.
          properties:
            include_usage:
              type: boolean
              description: Send a final usage chunk with empty choices before [DONE].
              default: false
      description: Top-level null fields are treated as omitted.
    ChatCompletion:
      type: object
      required:
        - id
        - object
        - created
        - model
        - choices
        - usage
      properties:
        id:
          type: string
          examples:
            - chatcmpl-6f1c2e0d9b6a4f3c8e7d5b4a3c2e1f0a
        object:
          type: string
          const: chat.completion
        created:
          type: integer
          description: Unix time in seconds.
        model:
          type: string
        choices:
          type: array
          items:
            type: object
            required:
              - index
              - message
              - finish_reason
            properties:
              index:
                type: integer
                const: 0
              message:
                type: object
                required:
                  - role
                  - content
                properties:
                  role:
                    type: string
                    const: assistant
                  content:
                    type: string
                    description: The answer, with any thinking taken out.
                  reasoning_content:
                    type: string
                    description: >-
                      The model's thinking, when it thought before answering.
                      Present only then.
              finish_reason:
                type: string
                enum:
                  - stop
                  - length
                description: >-
                  length when the model reports reaching the output budget or
                  its thinking is unfinished. Otherwise stop.
        usage:
          $ref: '#/components/schemas/ChatUsage'
    ChatCompletionChunk:
      type: object
      description: >-
        A reply chunk, a finishing choice with an empty delta, or the optional
        final usage chunk with empty choices.
      required:
        - id
        - object
        - created
        - model
        - choices
      properties:
        id:
          type: string
        object:
          type: string
          const: chat.completion.chunk
        created:
          type: integer
        model:
          type: string
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
                const: 0
              delta:
                type: object
                properties:
                  role:
                    type: string
                    const: assistant
                  content:
                    type: string
                  reasoning_content:
                    type: string
                    description: >-
                      A thinking model's reasoning, sent whole in one chunk
                      before the answer.
              finish_reason:
                type:
                  - string
                  - 'null'
                enum:
                  - stop
                  - length
                  - null
        usage:
          $ref: '#/components/schemas/ChatUsage'
    StreamError:
      type: object
      required:
        - error
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ErrorDetail'
            - type: object
              required:
                - status
              properties:
                status:
                  type: integer
                  description: Equivalent HTTP error status after the stream opened.
    ChatMessage:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - system
            - developer
            - user
            - assistant
          description: A developer message is treated as a system message.
        content:
          description: >-
            The message text, or an array of text parts, which are joined
            together. Image parts are refused.
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                required:
                  - type
                  - text
                properties:
                  type:
                    type: string
                    const: text
                  text:
                    type: string
    ChatUsage:
      type: object
      description: >-
        Token counts. `prompt_tokens` is an estimate (characters divided by
        four). `completion_tokens` is the model's own count when it reports one,
        otherwise also an estimate.
      properties:
        prompt_tokens:
          type: integer
        completion_tokens:
          type: integer
        total_tokens:
          type: integer
        cost_credits:
          type: number
          description: Job price in credits, based on the effective output budget.
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
        - cost_credits
    ErrorDetail:
      type: object
      required:
        - message
        - type
        - param
        - code
      properties:
        message:
          type: string
          description: What went wrong, for a person to read.
        type:
          type: string
          description: >-
            402 uses insufficient_quota, other 4xx errors use
            invalid_request_error, and 5xx errors use api_error.
          enum:
            - invalid_request_error
            - insufficient_quota
            - api_error
        param:
          type:
            - string
            - 'null'
          description: The request field at fault, when there is one.
        code:
          type:
            - string
            - 'null'
          description: A stable code. The Errors and limits page lists them all.
          examples:
            - model_not_found
        price_credits:
          type: number
          description: Job price in credits on an insufficient_quota error.
        balance_credits:
          type: number
          description: Account balance in credits on an insufficient_quota error.
      if:
        properties:
          code:
            const: insufficient_quota
      then:
        required:
          - price_credits
          - balance_credits
    Error:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
  headers:
    x-request-id:
      description: Identifier for this API response.
      schema:
        type: string
    x-ratelimit-limit-concurrent:
      description: Job slots per account across all tokens.
      schema:
        type: integer
        const: 4
    x-ratelimit-remaining-concurrent:
      description: Free account slots when headers are sent.
      schema:
        type: integer
        minimum: 0
        maximum: 4
    X-ShareMyAI-Cost-Credits:
      description: >-
        Quoted price in credits when a job was accepted. For a Janus batch, the
        total for completed pictures.
      schema:
        type: number
    X-ShareMyAI-Balance-Credits:
      description: >-
        Balance in credits after the hold, from the last successful quote on a
        Janus batch.
      schema:
        type: number
    X-ShareMyAI-Max-Tokens:
      description: Only on chat requests whose output budget was capped.
      schema:
        type: integer
        const: 4096
    x-should-retry:
      description: >-
        Suppress automatic retries for insufficient_quota,
        content_policy_violation or no_provider.
      schema:
        type: string
        const: 'false'
    Allow:
      description: Methods available for the requested path, including OPTIONS.
      schema:
        type: string
    Retry-After:
      description: >-
        Seconds to wait. 2 on async submission and unfinished polls, 1 on a 429,
        and 30 on HTTP 503 no_provider.
      schema:
        type: integer
  responses:
    BadRequest:
      description: >-
        A field failed validation (invalid_value, model_not_found or
        unsupported_value), the body could not be read (null), a content check
        failed (content_policy_violation), or the job input was malformed
        (invalid_input).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Choose a temperature from 0 to 2.
              type: invalid_request_error
              param: temperature
              code: invalid_value
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        X-ShareMyAI-Cost-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Cost-Credits'
        X-ShareMyAI-Balance-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Balance-Credits'
        X-ShareMyAI-Max-Tokens:
          $ref: '#/components/headers/X-ShareMyAI-Max-Tokens'
        x-should-retry:
          $ref: '#/components/headers/x-should-retry'
    Unauthorized:
      description: >-
        The message distinguishes a missing token, a key without the smai_
        prefix and an unknown or revoked ShareMyAI token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: >-
                Send your API token as Authorization: Bearer smai_…. Create one
                at https://sharemy.ai, account panel, API tokens.
              type: invalid_request_error
              param: null
              code: invalid_api_key
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
    InsufficientCredits:
      description: The balance is less than the job's price.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: >-
                This costs 8.192 credits and your balance is 3.000 credits. Add
                credits at https://sharemy.ai.
              type: insufficient_quota
              param: null
              code: insufficient_quota
              price_credits: 8.192
              balance_credits: 3
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        X-ShareMyAI-Max-Tokens:
          $ref: '#/components/headers/X-ShareMyAI-Max-Tokens'
        x-should-retry:
          $ref: '#/components/headers/x-should-retry'
    Suspended:
      description: The account is suspended.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: >-
                This account is suspended. If you think that is a mistake,
                contact us.
              type: invalid_request_error
              param: null
              code: account_suspended
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        X-ShareMyAI-Cost-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Cost-Credits'
        X-ShareMyAI-Balance-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Balance-Credits'
        X-ShareMyAI-Max-Tokens:
          $ref: '#/components/headers/X-ShareMyAI-Max-Tokens'
    MethodNotAllowed:
      description: The path exists. Use a method listed in Allow (method_not_allowed).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        Allow:
          $ref: '#/components/headers/Allow'
    TooManyCalls:
      description: >-
        Four job calls are already in flight across the account's tokens, or
        eligible machines stayed busy for 10 minutes. Both return
        rate_limit_exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: At most 4 API calls at once. Wait for one to finish.
              type: invalid_request_error
              param: null
              code: rate_limit_exceeded
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        X-ShareMyAI-Cost-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Cost-Credits'
        X-ShareMyAI-Balance-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Balance-Credits'
        X-ShareMyAI-Max-Tokens:
          $ref: '#/components/headers/X-ShareMyAI-Max-Tokens'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
    Cancelled:
      description: >-
        The caller hung up before the job finished. The job was dropped and its
        credits returned.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        X-ShareMyAI-Cost-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Cost-Credits'
        X-ShareMyAI-Balance-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Balance-Credits'
        X-ShareMyAI-Max-Tokens:
          $ref: '#/components/headers/X-ShareMyAI-Max-Tokens'
    NetworkError:
      description: >-
        The job failed on the network, for example after three machines in turn
        left or stopped answering. Its credits were returned.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: >-
                The machine running this left the network. (request
                69ba81e5-6a67-4cd5-a28b-2e023337b936)
              type: api_error
              param: null
              code: network_error
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        X-ShareMyAI-Cost-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Cost-Credits'
        X-ShareMyAI-Balance-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Balance-Credits'
        X-ShareMyAI-Max-Tokens:
          $ref: '#/components/headers/X-ShareMyAI-Max-Tokens'
    NoProvider:
      description: >-
        No machine offers the model at submission, or an accepted job has had no
        eligible machine for about a minute.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: >-
                No machine that runs this model is online right now. (request
                69ba81e5-6a67-4cd5-a28b-2e023337b936)
              type: api_error
              param: null
              code: no_provider
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        X-ShareMyAI-Cost-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Cost-Credits'
        X-ShareMyAI-Balance-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Balance-Credits'
        X-ShareMyAI-Max-Tokens:
          $ref: '#/components/headers/X-ShareMyAI-Max-Tokens'
        x-should-retry:
          $ref: '#/components/headers/x-should-retry'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API token from the account panel on sharemy.ai. Tokens start with
        `smai_`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.