Build on HostAfrica with one API

Automate VPS provisioning, networking, security, backups, and monitoring through the public API, the HA CLI, or an MCP-compatible interface - all generated from the same OpenAPI contract.

Choose the interface that fits your workflow.

Use the same HostAfrica token across the public API, the HA CLI, MCP, and SDKs.

  • Public API

    For teams integrating HostAfrica into products, portals, and backend workflows.

    Use the REST API to provision services, manage networking, trigger backups, check service status, and connect HostAfrica to your own systems.

    • Best for product integrations and backend services
    • Generated from the OpenAPI contract
    • Works with Postman, SDKs, and custom clients
  • HA CLI

    For operators who live in shell scripts, jobs, and runbooks.

    The HA CLI gives you the same platform capabilities from the terminal - ideal for quick checks, CI jobs, and repeatable operations.

    • Best for scripting and CI/CD automation
    • Uses the same API token
    • Easy to audit, version, and run at scale
  • MCP Server

    For AI agents that need structured access to HostAfrica.

    The MCP server exposes approved HostAfrica actions to agent workflows, so assistants can inspect services, suggest changes, and run permitted operations.

    • Best for AI-assisted operations
    • No custom API wrapper required
    • Scope access through the same token model

Start with the same token. Move through the interface that fits.

Generate one bearer token, then use it from curl, the CLI, MCP, or an SDK.

  1. Generate a token

    Generate a bearer token in the HostAfrica Client Area (opens in new tab).

  2. Make your first request

    Make a first authenticated request to https://api.hostafrica.com.

  3. Scale with the CLI or MCP

    Switch to the CLI or MCP once you want reusable ops or agent workflows.

New to the API? Follow the full Getting Started guide.

export HA_TOKEN=<your-bearer-token>

curl https://api.hostafrica.com/vps/list-vps-services \
  -H "Authorization: Bearer $HA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"page":1,"page_size":10}'

Infrastructure jobs you can automate today.

Everything below is a real endpoint you can call today.

  • VPS management

    List services, inspect configs, mount ISOs, and reinstall operating systems.

    Explore VPS docs
  • Power management

    Start, stop, reboot, shutdown, and schedule recurring power actions.

    Explore power docs
  • Backups and schedules

    Create and manage backups without leaving your workflow.

    Explore backup docs
  • Firewall and security

    Control inbound and outbound rules, rotate credentials, and manage SSH keys.

    Explore security docs
  • DNS and reverse DNS

    Map allocated IPs back to hostnames and keep naming consistent across services.

    Explore DNS docs

One contract. Consistent docs, SDKs, and tooling.

Reference docs, a Postman collection, the HA CLI, and official SDKs.

Available now

ToolTypeAccess
API DocsReferenceOpen
Postman CollectionCollectionDownload
HA CLICLIRepo
TypeScript SDKSDKRepo
Python SDKSDKRepo
Go SDKSDKRepo
PHP SDKSDKRepo

Coming soon

ToolTypeStatus
Java SDKSDKComing soon
C# SDKSDKComing soon
Ruby SDKSDKComing soon
Rust SDKSDKComing soon

MCP for agent workflows. CLI for repeatable operations.

Both reach the same platform - pick by how your agents and scripts run.

  • MCP

    Best when you want the quickest route from plain-language intent to structured tool execution.

    • No shell access required
    • Tool schemas guide the agent
    • Best starting point for Cursor-style workflows
    • Tradeoff: larger responses land in model context more often
  • CLI

    Best when you need filtered output, reusable shell scripts, or lower token usage in repeated agent runs.

    • Great for scripts, jobs, and terminal-native ops
    • Easy to pipe through jq before output reaches an agent
    • More flexible when combining operations
    • Tradeoff: requires shell access and command awareness

For a full breakdown of all three approaches - including direct HTTP and token-cost tradeoffs - read the Using Agents guide.

Frequently asked questions

Common questions about the HostAfrica API, CLI, and MCP surface.

Do I have to be a HostAfrica customer to use the public API?
Yes, you can register an account at HostAfrica. To enable API access and obtain your bearer token, use your HostAfrica credentials to log in to the HostAfrica Client Area.
How do I get an API token?
Sign in to the HostAfrica Client Area with your HostAfrica credentials and generate a bearer token, then pass it as a Bearer header on your requests. The API itself is free - you only pay for the VPS services you run. Don't have an account yet? Register at HostAfrica first.
Can I order a VPS service via the public API?
Yes. Access to the API itself is free, but to order a VPS service you need to have a verified payment method configured for automated payments.
Which programming languages and SDKs are supported?
You can call the REST API from any language. We publish official SDKs for TypeScript, Python, Go, and PHP, with more in progress, and the HA CLI wraps the same API for shell and scripting workflows.
Is the API enabled for AI?
Yes, AI agents enabled by Large Language Models (like Claude Opus, Google Gemini, etc.) can use the API in multiple ways, directly or by connecting via our MCP server. See the API reference documentation and the MCP guide for more information.
Does HostAfrica have an MCP server for AI agents?
Yes. Our streamable MCP surface exposes the same platform as structured tool calls, so AI agents and assistants can operate your VPS - power, backups, firewall, DNS and more - without shell access. Follow the MCP guide to connect, or read the API reference for the underlying endpoints.
Where can I find more information about HostAfrica server hosting?
Visit our server hosting page to find out more about the virtual and dedicated server hosting options we provide.

Need a hand getting started?

Our support team is here around the clock to help you build on the HostAfrica platform.