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

# Markdown files

> Use Markdown files as text context in Conversation and API calls for README files, docs, notes, and changelogs.

Markdown files are useful for README files, API docs, project notes, meeting notes, knowledge base entries, and changelogs. Moxus AI supports `.md` and `.markdown` uploads in Conversation. For API calls, read the Markdown content and place it in the message text.

## Supported paths

<Columns cols={2}>
  <Card title="Conversation upload" icon="message-square">
    Upload a `.md` or `.markdown` file in Conversation. The file is read as text and sent with the current message.
  </Card>

  <Card title="API call" icon="code-xml">
    Read the Markdown file in your backend and append its content to `messages.content`.
  </Card>
</Columns>

## File rules

| Field            | Details                                             |
| ---------------- | --------------------------------------------------- |
| Formats          | `.md`, `.markdown`                                  |
| Content type     | `text/markdown`                                     |
| Single file size | About 20MB for Conversation uploads                 |
| Billing          | Billed by the text tokens included in the request   |
| Best model type  | Chat or reasoning models with enough context length |

Markdown files are not sent as `image_url` parts like images, and they are not sent as file objects like PDFs. They are read as text and appended to the user message.

## Use in Conversation

<Steps>
  <Step title="Open Conversation">
    Sign in, open Conversation, and choose a model that can handle long text.
  </Step>

  <Step title="Upload a Markdown file">
    Click the attachment button in the input box and choose a `.md` or `.markdown` file. The file appears in the attachment area.
  </Step>

  <Step title="Describe the task">
    Tell the model what to do, such as summarize the document, extract API sections, review a changelog, or rewrite the content.
  </Step>

  <Step title="Send and review">
    The Markdown content is sent with your message. After the request, open Usage to review the call and cost.
  </Step>
</Steps>

## API example

For API calls, read the Markdown file in your program and include its content in `messages.content`:

<CodeGroup>
  ```bash cURL theme={null}
  MARKDOWN_CONTENT="$(cat README.md)"

  curl https://moxus.ai/v1/chat/completions \
    -H "Authorization: Bearer sk-your-key" \
    -H "Content-Type: application/json" \
    -d "$(jq -n --arg content "$MARKDOWN_CONTENT" '{
      model: "gpt-4o",
      messages: [
        {
          role: "user",
          content: "Summarize this Markdown file and list the key features:\n\nMarkdown file: README.md\n\n\($content)"
        }
      ]
    }')"
  ```

  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(
      api_key="sk-your-key",
      base_url="https://moxus.ai/v1",
  )

  with open("README.md", "r", encoding="utf-8") as file:
      markdown = file.read()

  response = client.chat.completions.create(
      model="gpt-4o",
      messages=[
          {
              "role": "user",
              "content": f"Summarize this Markdown file and list the key features:\n\nMarkdown file: README.md\n\n{markdown}",
          }
      ],
  )

  print(response.choices[0].message.content)
  ```

  ```javascript Node.js theme={null}
  import OpenAI from "openai";
  import { readFileSync } from "node:fs";

  const client = new OpenAI({
    apiKey: "sk-your-key",
    baseURL: "https://moxus.ai/v1",
  });

  const markdown = readFileSync("README.md", "utf8");

  const response = await client.chat.completions.create({
    model: "gpt-4o",
    messages: [
      {
        role: "user",
        content: `Summarize this Markdown file and list the key features:\n\nMarkdown file: README.md\n\n${markdown}`,
      },
    ],
  });

  console.log(response.choices[0].message.content);
  ```
</CodeGroup>

## Recommendations

* Remove unrelated logs, repeated tables of contents, and generated content before sending long files.
* Keep headings, section names, and list numbers when you need traceable answers.
* Use [Structured output](/en/guide/structured-output) when you need JSON or predictable fields.
* If you send images, PDFs, and Markdown together, describe the role of each attachment in your prompt.

<Warning>
  Markdown files may contain internal links, example keys, config snippets, or private code. Remove sensitive content before uploading or sending it through the API.
</Warning>

## Next steps

* [Conversation](/en/platform/playground)
* [Quickstart](/en/overview/quickstart)
* [Structured output](/en/guide/structured-output)
