> For the complete documentation index, see [llms.txt](https://docs.api.market/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.api.market/seller-docs/importing-an-api-source.md).

# Importing an API Source

To create an API store, you first connect your APIs to [API.market](https://api.market/). When a user calls API.market, the platform calls your API using the API Source you define and its configuration.

#### 🎯 Overview

The **API Source** is the OpenAPI specification that connects your APIs to API.market. API.market acts as an API gateway, making your API available through a unified platform.

{% hint style="info" %}
💡 **How it works:** API.market proxies requests to your API using the OpenAPI specification. This lets API.market handle authentication, billing, analytics, and rate limiting automatically.
{% endhint %}

#### 📋 Prerequisites

Before you begin, you will need:

✅ An OpenAPI specification file (YAML or JSON)\
✅ Your API's base URL\
✅ Authentication details (if required)

{% hint style="warning" %}
⚠️ **Don't have an OpenAPI spec yet?** You can create one using ChatGPT. Follow our guide: [Create OpenAPI spec using ChatGPT](/fundamentals/create-openapi-spec-using-chatgpt.md)
{% endhint %}

#### 🚀 Step-by-step guide

**Step 1 — Open "OpenAPI Specs"**

Go to the Seller Console and select your organization from the dropdown. Then click **"Manage APIs"** in the left sidebar and select **"OpenAPI Specs"**.<br>

<div data-with-frame="true"><figure><img src="/files/AGcQN0gYyCcBqI0xE6wT" alt=""><figcaption></figcaption></figure></div>

***

**Step 2 — Import the OpenAPI YAML or JSON file**

Upload or drag and drop your OpenAPI specification file. You should see the paths imported from the file.

<div data-with-frame="true"><figure><img src="/files/I50h0mSkT3wSQ29CBMox" alt=""><figcaption></figcaption></figure></div>

**Step 3 — Configure custom headers**

Next, add any custom headers that should be included in every API request to your backend.

1. Enter a JSON object in the text area.
2. Format: `{"Header-Name": "header-value"}`
3. Example:

```json
{
  "Content-Type": "application/json",
  "Accept": "application/json",
  "X-Custom-Header": "custom-value"
}
```

{% hint style="info" %}
💡 **No custom headers?** Leave this as `{}` (an empty JSON object) and continue.
{% endhint %}

<div data-with-frame="true"><figure><img src="/files/IlzMIhrnlIf2V5DUj5FT" alt=""><figcaption></figcaption></figure></div>

**Step 4 — Configure base path URL**

Set the base URL for all API requests. This is the root address API.market will call.

1. The field may be pre-filled if a `servers` entry was detected in your OpenAPI spec.
2. Review or enter your API's base URL.
3. Format: `https://api.example.com/v1`
4. This URL is used as the base for every API request.

**Example:**

```
https://api.example.com/v1
```

<div data-with-frame="true"><figure><img src="/files/acg5ph2csSt1zO02CObq" alt=""><figcaption></figcaption></figure></div>

**Step 5 — Configure authentication**

Choose how API.market authenticates with your backend when it forwards a request. You have five options.

**Option 1 — No authentication**

* Select the **"None"** tab.
* No authentication is used when making API requests.

<div data-with-frame="true"><figure><img src="/files/1jBd2jdBAOvZUYkCrBLF" alt=""><figcaption></figcaption></figure></div>

**Option 2 — API Key**

* Select the **"API Key"** tab.
* Enter the **Header Name** (e.g. `X-API-Key`, `Authorization`).
* Enter the **API Key Value** (masked for security).
* The API key is sent in the specified header with each request.

*Example —* Header Name: `X-API-Key` · API Key Value: `your-secret-api-key`

<div data-with-frame="true"><figure><img src="/files/3309hhgB6CddZzjoKXKC" alt=""><figcaption></figcaption></figure></div>

**Option 3 — Bearer Token**

* Select the **"Bearer Token"** tab.
* Enter your bearer token (masked for security).
* The token is sent in the `Authorization` header as `Bearer <token>`.

*Example —* Token: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...`&#x20;

<div data-with-frame="true"><figure><img src="/files/j6AzrGD8jiIUh3mkMuZE" alt=""><figcaption></figcaption></figure></div>

**Option 4 — Basic Auth**

* Select the **"Basic Auth"** tab.
* Enter your **Username** and **Password** (masked for security).
* Credentials are base64 encoded and sent in the `Authorization` header.

*Example —* Username: `myuser` · Password: `mypassword`&#x20;

<div data-with-frame="true"><figure><img src="/files/R210x2i0goCIWF78YtIs" alt=""><figcaption></figcaption></figure></div>

**Option 5 — Query Parameter**

* Select the **"Query Param"** tab.
* Enter the **Parameter Key** (e.g. `api_key`, `token`).
* Enter the **Parameter Value** (masked for security).
* The parameter is added to the query string of each request.

*Example —* Param Key: `api_key` · Param Value: `your-api-key-value`

<div data-with-frame="true"><figure><img src="/files/DsueaMCIi4CCQZpujeDe" alt=""><figcaption></figcaption></figure></div>

{% hint style="warning" %}
🔒 **Security:** Your backend credentials are stored securely and never shown to your customers. Customers authenticate with API.market using their own key.
{% endhint %}

**Step 6 — Review summary and create**

Review all your configuration before creating the API Source. The summary shows:

* **API Source Name** — the detected or entered name
* **API Version** — the detected version
* **Base URL** — the configured base URL
* **Custom Headers** — the JSON object of custom headers
* **Authentication** — the selected method and configuration
* **Endpoints** — the list of all detected endpoints

<figure><img src="/files/a8WdmyLxw4UYq6xV3GvR" alt=""><figcaption></figcaption></figure>

**Review checklist:**

* ✅ API name and version are correct
* ✅ Base URL is correct
* ✅ Custom headers are properly formatted
* ✅ Authentication is configured correctly
* ✅ All expected endpoints are listed

Then click **"Create API Source"**. Your API Source is created and you are taken back to the API Sources list, where you should see it appear.

{% hint style="success" %}
🎉 **Success!** Your API Source is ready to use when creating products.
{% endhint %}

***

#### ✅ What's next?

After importing your API Source, you can:

1. **Create products** — use your API Source to create API products
2. **Configure pricing plans** — set up pricing for your endpoints
3. **Test your APIs** — use the API Playground to test your endpoints
4. **View analytics** — monitor usage and performance

***

#### 🛠️ Troubleshooting

**"No endpoints found"**\
Check that your OpenAPI spec has a `paths` object with at least one endpoint defined.

**"Invalid JSON/YAML"**\
Validate your OpenAPI spec with an online tool such as [Swagger Editor](https://editor.swagger.io/).

**"Base URL not detected"**\
Make sure your spec includes a `servers` array with at least one URL, or enter it manually in Step 5.

**"Authentication not working"**\
Verify your credentials are correct, check that the header name matches what your API expects, and confirm the authentication type matches your API's requirements.

***

#### 💡 Best practices

1. **Validate your OpenAPI spec** — use tools like Swagger Editor before importing.
2. **Test authentication** — after creating your source, test it with a sample request.
3. **Use descriptive names** — pick clear API Source names you can identify later.
4. **Document custom headers** — keep track of what headers you use and why.
5. **Version your APIs** — use semantic versioning (e.g. `1.0.0`, `2.1.3`).

***

**Next →** [What Is an API Product](/what-are-api-products.md)
