Know a company with years of records? Refer it and earn up to $50K
Guide

Can a company sell its source code to AI companies for training?

What private code bases have sold for, why commit history and linked issues matter more than lines of code, and the ownership and license checks to run first.

A laptop showing a code diff with a sprint board behind
Short answer

Yes. AI developers buy private code bases to train and test coding agents. One closed startup reportedly received about $25,000 for its code base in 2026, and an app store operator has reportedly offered developers payment for their app code. Buyers value production code with its history: commits, pull requests, review comments, tests and the issues each change fixed. Before selling, confirm the company owns every part of the code, separate open-source and third-party components, remove secrets from the history, and license rather than assign it if the business is still operating.

  • Repository history is the product. A commit linked to its issue and review shows how engineers reason.
  • Ownership gaps kill code deals: contractor code without IP assignment, client work and vendored libraries.
  • An operating company should license a copy with use limits, not sell the code outright.

Do AI companies buy private source code?

Yes. Public code is available to every AI lab, so private production code with its history is what buyers pay for. A crypto startup founder received roughly $25,000 for his code base, MIT Technology Review reported in October 2026; buyers valued code using estimates of how many useful training tasks it could produce, for example per 100,000 lines. In June 2026 a large app store operator was reported to be offering some developers money for their apps' code to train AI, terms undisclosed (RuntimeWire, citing 404 Media).

What buyers use code for

Coding agents learn from tasks: here is a bug report, here is the repository, produce the fix and pass the tests. A private repository with real issues, real fixes and real tests can be turned into many such tasks. A repository that is only a final snapshot cannot.

What makes a code base worth more

Raises valueLowers value
Full git history with meaningful commit messagesA single squashed snapshot
Pull requests with review comments and linked issuesChanges with no record of why they were made
A working test suite and build configurationCode that no longer builds
Production code used by real customersPrototypes, tutorials and abandoned branches
A specialized domain: payments, logistics, industrial control, healthcare workflowsGeneric web templates found in many public projects

Ownership and license checks before selling code

  • Who wrote it. Code from contractors or agencies belongs to the company only if their contracts assigned the IP. Check every significant contributor.
  • Client work. Code built for a client under a services agreement often belongs to the client or carries confidentiality terms. Exclude it unless the contract allows reuse.
  • Open-source components. Vendored libraries keep their own licenses, and copyleft licenses such as the AGPL carry conditions. List third-party code and exclude or document it.
  • Commercial SDKs and licensed code. Vendor agreements usually forbid redistribution.
  • Secrets and data in history. API keys, passwords and customer data in test fixtures stay in old commits even after deletion. Scan the full history, not just the latest version.
  • Competitive exposure. Licensing code that still runs your product gives a third party a copy of your core asset. Limit use to model training, ban redistribution, and require deletion at the end of the term.

How to describe a code base without sharing it

  • Repositories, languages and frameworks, with approximate size.
  • Years of history, number of contributors, and whether issues and pull requests are linked.
  • Whether tests run and the build works today.
  • Known exclusions: client projects, third-party code and anything with customer data.

When not to sell your code

If ownership of key components is unclear, if the code is the main thing competitors would want, or if customer contracts promised the software stays confidential, the payment rarely justifies the risk. Archived products, retired platforms and the code of a business that is winding down are the most common fits.

Origin Data Partners is not a law firm. This guide summarizes public sources so you can frame questions for your own counsel. It is not legal advice.

Common questions

How much do AI companies pay for a code base?

One closed startup reportedly received about $25,000 in 2026. Buyers estimate how many useful training tasks the code can produce, so history, tests and linked issues matter more than raw size.

Can I sell code that contractors wrote?

Only if their contracts assigned the intellectual property to the company. Without an assignment, the contractor may still own it.

Does selling code to an AI company mean giving up ownership?

Not if you license it. A license grants a buyer defined rights to use a copy while your company keeps ownership.

Sources and further reading

Origin Data Partners is independent and not affiliated with any buyer named on this page.

What is your company’s data worth?

AI companies pay $20K to $5M for company records. Six questions, no files.