Skip to content
IT Vizag
← Production Python

▶ Sign up free for the video, slides & prompts

The lesson below is open to all. Enter your email once to unlock every video, slide deck, prompt and code example on this device.

Checking…

Deploy for free

Lesson 9 of 10 · 2 min read

Put your API online and share the link.

🎬 Video version coming soon — read it now

An API on your laptop is a project. An API on the internet, with a link you can share, is a portfolio piece. Several platforms offer free or low-cost tiers suitable for learning projects.

Options to look at

Free tiers and limits change often, so check each platform's current pricing page:

  • Render: connects to your GitHub repo and builds from a Dockerfile or a Python start command. Free web services typically sleep when idle and take a few seconds to wake up
  • Hugging Face Spaces: free hosting for demos, including Docker-based apps, popular for AI projects
  • Railway, Fly.io, Koyeb: similar container-hosting platforms, with trial credits or small free allowances
  • Google Cloud Run, AWS and Azure: generous free tiers but more setup, and you'll usually need a payment card

The general flow (Render as the example)

  1. Push your project to GitHub, with the Dockerfile and .dockerignore, and without .env.
  2. On Render: New → Web Service → connect your repository.
  3. Choose Docker as the runtime (or a Python start command like fastapi run main.py --port $PORT).
  4. In Environment, add ANTHROPIC_API_KEY and any other settings.
  5. Set the health check path to /health.
  6. Deploy. A few minutes later you get a URL like https://feedback-api.onrender.com.

From then on, every push to the main branch deploys automatically.

Listen on the platform's port

Many platforms tell your app which port to use through a PORT environment variable:

🔒 Code example: sign up free (above) to unlock it.

After deploying: check it like a user

  • Open /docs on the live URL and try every endpoint
  • Check the platform's logs for errors and startup messages
  • Try bad input: does it fail politely?
  • Watch your AI provider's usage dashboard after testing

Protect a public AI endpoint

A public URL that calls a paid AI model is an open wallet. Before sharing the link widely:

  • Require an access key for the AI endpoint, or keep a strict per-user rate limit
  • Keep the input length limit
  • Set a low monthly spending limit at the AI provider
  • Consider a demo mode that serves cached example answers to anonymous visitors

Show it off

Add to your README and resume: the live URL, the /docs link, a screenshot, the tech stack (FastAPI, Pydantic, Docker, pytest) and one line on what you learned. A working link gets far more attention from recruiters than "built a project".

Tip: Free services that sleep can make the first request slow. Mention "the first request may take a few seconds to wake the server" in your README so reviewers don't think it's broken.

In one line

Push to GitHub, connect a hosting platform, set secrets and a health check in its dashboard, and protect any public AI endpoint before sharing the link.

Saved on this device. Sign in to keep progress everywhere.

Share with a friend