# How to sell source code to AI companies

URL: https://sellmydatatoai.net/guides/sell-source-code-to-ai-companies
Reviewed: 2026-11-08

You can sell source code to AI companies through code marketplaces, closure brokers, training-data companies and direct programs. Buyers pay most for private, human-written production code with full engineering history, and DataVendor says systems languages such as Rust, Go, C and C++ attract more. First confirm you own every line, strip secrets and customer data, and remove third-party code.

## Key takeaways

- Labs pay more for code written mostly by people, for complex production systems and for systems languages, according to DataVendor.
- Mercor's published range for software companies is $50,000 to $500,000 for 15 to 500 staff, while one small closed startup received about $25,000 for its code.
- Under US copyright law, contractors usually own the code they write unless they assigned it to you in a signed writing, so check every agreement before you list a repository.
- Scan the full commit history for secrets, rotate every credential found and replace real customer data in test fixtures.
- Non-exclusive licenses let one repository earn from several buyers, which DataVendor says can beat a single exclusive deal.

AI companies buy source code because coding models and agents learn more from real engineering history than from public snippets. DataVendor, a marketplace for code repositories run by HUD, says on its blog that "labs pay more for code written mostly by people", and that complex products and systems languages such as Rust, Go, C and C++ attract higher prices.

Demand now reaches beyond specialist marketplaces. 404 Media reported in June 2026, as summarized by AI Weekly, that Google was running a confidential pilot to buy non-public production code and archived app projects from Android developers on a non-exclusive basis, with emails telling developers they could "retain 100% of your IP". Our page on [source code datasets](https://sellmydatatoai.net/buy-ai-training-data/source-code-datasets) covers what buyers check.

## Do AI companies buy source code?

AI companies do buy source code, through four main routes: code marketplaces, closure brokers, training-data companies and direct programs run by large technology firms.

| Route | Example | What it says it buys |
| --- | --- | --- |
| Code marketplace | DataVendor | Code repositories, raw data archives and RL tasksets, previewed as a file tree |
| Closure broker | SimpleClosure AssetHub | Codebases, repositories, documentation and tests from companies shutting down |
| Training-data company | Mercor | Software company data, with a published range of $50,000 to $500,000 for 15 to 500 staff |
| Direct program | Google (reported pilot) | Non-public production code and archived Android app projects |

The Mercor range comes from its referral page as recorded by ddiy.co on October 26, 2026. Code also feeds agent training. MIT Technology Review reported in October 2026 that Surge AI buys data to build reinforcement learning environments where AI agents practice tasks.

## What makes a codebase valuable to AI buyers?

A codebase is valuable to AI buyers when it shows how real people built, tested and maintained a working product over time. DataVendor says labs value private engineering history because public repositories rarely preserve the full operational record.

| Factor | Worth more | Worth less |
| --- | --- | --- |
| Authorship | Written mostly by people | Largely generated by AI tools |
| Availability | Private and never published | Mirrored on GitHub or similar |
| History | Commits, pull requests, review comments, issues, incident notes and runbooks | A single snapshot of the current code |
| Complexity | Production systems with real users | Tutorials, prototypes and templates |
| Language | Rust, Go, C and C++, according to DataVendor | Languages with plentiful public code |
| Tests | Test suites and CI history showing what passed and failed | No tests |

The context around the code often matters as much as the code. DataVendor lists pull requests, issue tickets, runbooks and incident notes as the material that explains why code changed, which is exactly what a coding agent needs to learn from.

## How much is source code worth to AI companies?

Source code is worth anything from a few thousand dollars to hundreds of thousands, depending on size, history and exclusivity. The published figures are:

- Mercor's listing puts software companies at $50,000 to $500,000 for 15 to 500 staff, per ddiy.co in October 2026
- A winding-down crypto startup received about $25,000 for its codebase, according to MIT Technology Review in October 2026
- SimpleClosure's typical payments run $10,000 to $100,000 per company across code and data, according to Fortune in September 2026

DataVendor cautions that a listed price or a large catalog does not establish what an asset will earn. Use the figures to decide whether a sale is worth preparing for, not as a quote. Our guide to [what your data is worth](https://sellmydatatoai.net/guides/how-much-is-your-data-worth-to-ai) explains the other factors.

## Do you own the code you want to sell?

You own the code you want to sell only if your company holds the copyright in every part of it. Under section 201(b) of the US Copyright Act, the employer is considered the author of a work made for hire, which section 101 defines to include a work prepared by an employee within the scope of his or her employment.

Contractors are different. A commissioned work counts as a work made for hire only in nine listed categories, such as a compilation or a contribution to a collective work, and only where both parties sign a written agreement saying so. Code written by freelancers or outside agencies may not fit those categories, so it can stay with them unless they assigned it to you. Section 204(a) says a transfer of copyright ownership is not valid unless it is in writing and signed by the owner. Check every contractor agreement before listing a repository.

Client work is the other trap. Development contracts often assign the code to the client, and that code is not yours to license even if it sits in your repositories. A clean [chain of title](https://sellmydatatoai.net/glossary/chain-of-title) for each repository is what buyers ask for first. See our page for [software companies](https://sellmydatatoai.net/sell-your-data/software-companies) for the contract issues that come up most.

## What about open-source code in your repositories?

Open-source code in your repositories has to be identified, recorded and either kept within its license terms or removed. DataVendor advises sellers to trace third-party dependencies and copied code, record each license, and remove material whose terms prohibit redistribution or commercial model training.

- Strip vendored dependencies and copied libraries. Buyers can get public code elsewhere, and it adds license risk without adding value.
- Run a software composition analysis tool to list the licenses found across the codebase.
- Flag snippets copied from forums or documentation, which may carry their own license terms.
- Record what you removed in the manifest so the buyer knows the package is your own work.

## What must you remove before selling code?

Before selling code you must remove secrets, real personal data and anything that would expose live systems. SimpleClosure says every dataset it handles is processed for personal data before licensing, and that sensitive information and credentials are de-identified.

| Item | Where it hides | What to do |
| --- | --- | --- |
| API keys and passwords | Config files, environment files, old commits | Scan the full history with a secret scanner and rotate every key found |
| Customer data | Test fixtures, seed databases, logs, screenshots | Replace with synthetic values |
| Staff identities | Commit author names and emails, code comments | Rewrite to consistent pseudonyms |
| Infrastructure details | Hostnames, IP addresses, internal URLs | Replace or remove |
| Unpatched vulnerabilities | Live production code | Fix them, or exclude the affected service |

Rotate any credential that ever appeared in the repository, even after deleting it from the history. Once a copy leaves your control you cannot recall it. Our [de-identification guide](https://sellmydatatoai.net/guides/de-identification-for-ai-training-data) covers the personal data side in detail.

## Should you license code exclusively or non-exclusively?

Licensing code non-exclusively usually suits sellers with high-quality codebases, because the same repository can earn from several buyers. DataVendor says a marketplace that licenses to many labs can earn more than a single exclusive deal for such assets, and Google's reported pilot was non-exclusive.

Exclusive deals pay more per buyer. AIData.Broker estimates an exclusive deal at about 2.5 to 5 times the price of a non-exclusive one, as reported by ddiy.co. If you are still trading, also consider whether a model trained on your code could help a competitor. Our guide to [exclusive and non-exclusive licenses](https://sellmydatatoai.net/guides/exclusive-vs-non-exclusive-data-licenses) sets out the trade-off.

## How do you sell source code step by step?

You sell source code step by step by choosing the right repositories, proving ownership, cleaning the history and only then talking to buyers.

1. **Pick the repositories**: Choose production systems with long histories. List each one with its language, age, number of contributors, commit count and whether it has tests.
2. **Check ownership**: Confirm employee and contractor IP assignments and check client contracts for every repository.
3. **Clean the history**: Remove vendored code, scan for secrets, rotate credentials, replace customer data and pseudonymize author details.
4. **Add the context**: Export pull requests, review comments, issues, runbooks and incident notes, and link them to the code they discuss.
5. **Write the manifest**: Record counts, languages, licenses found and removed, and file hashes. See [how to build a data manifest](https://sellmydatatoai.net/guides/how-to-build-a-data-manifest).
6. **Share a preview**: Show a file tree and redacted samples under a mutual NDA before any buyer sees full code.
7. **License and deliver**: Sign the license, deliver a fixed copy rather than repository access, and record the hash of what was delivered.

## If you hold UK or EU data

Code written by staff or contractors in the UK follows the Copyright, Designs and Patents Act 1988. Section 11(2) makes the employer the first owner of work an employee creates in the course of employment, subject to any agreement to the contrary. Contractors own what they write unless they assign it, and section 90(3) requires an assignment to be in writing and signed by the person assigning it. Personal data in commit history and test fixtures from UK or EU users also falls under UK GDPR or EU GDPR.

If you have production code with real history and want to know what buyers would pay for it, [book a free consultation](https://sellmydatatoai.net/book-a-consultation?side=seller). You can also read our profile of the code marketplace [DataVendor](https://sellmydatatoai.net/data-buyers/datavendor).

## Frequently asked questions

### Will AI companies buy code that was partly written with AI tools?

They may, but it is worth less. DataVendor says labs pay more for code written mostly by people, because models learn little from output similar to their own. Be honest in the manifest about how much of the codebase was AI-assisted and when that started, since buyers can often detect it and will reprice if they find it.

### Can I sell code I wrote for a client?

Usually not. Development contracts commonly assign copyright in the deliverables to the client, so the code is theirs even if it sits in your repositories. Check each contract. If you kept the rights or licensed the code to the client, you may be able to license it again, subject to confidentiality terms. Take advice before including any client project.

### Do I need to include the commit history?

You do not have to, but history is often where the value is. DataVendor says labs value private engineering history because public repositories rarely preserve the full operational record. Pull requests, review comments and incident notes show why code changed. Clean the history of secrets and personal data rather than deleting it.

### Is it safe to sell code from a product I still run?

It can be, if you remove secrets, rotate every credential, fix or exclude vulnerable services and replace customer data. The commercial question is harder: a model trained on your code may help competitors build similar features. Some sellers license older or retired systems only. Decide this before you approach buyers.

### How is source code usually priced?

Pricing varies by buyer. Marketplaces such as DataVendor set a price per repository, training-data companies such as Mercor publish ranges per company, and closure brokers such as SimpleClosure take a percentage of the deal. Exclusive licenses cost buyers more, about 2.5 to 5 times a non-exclusive deal on AIData.Broker's estimate.

## Sources

- [AI training data marketplaces](https://datavendor.ai/blog/ai-training-data-marketplaces), DataVendor, accessed November 2026
- [Google pays Play Store devs for code to train AI](https://aiweekly.co/alerts/google-pays-play-store-devs-for-code-to-train-ai), AI Weekly (reporting 404 Media), accessed November 2026
- [How to sell company data to AI companies (2026 guide)](https://ddiy.co/sell-company-data-to-ai/), ddiy.co, accessed November 2026
- [How much is company data worth to AI?](https://ddiy.co/how-much-is-company-data-worth-to-ai/), ddiy.co, accessed November 2026
- [AI labs are buying data from dead startups to train their models](https://www.technologyreview.com/2026/10/13/1145755/ai-labs-buying-data-from-dead-startups-to-train-models), MIT Technology Review, accessed November 2026
- [Google wants Spirit Airlines' data. Micro1 wants to pay more](https://fortune.com/2026/09/14/micro1-tries-to-beat-googles-bid-to-buy-bankrupt-spirit-airlines-data-for-12-5-million-highlighting-value-of-data-to-ai-companies/), Fortune, accessed November 2026
- [AssetHub](https://simpleclosure.com/product/assethub/), SimpleClosure, accessed November 2026
- [17 U.S. Code section 101: definitions](https://www.law.cornell.edu/uscode/text/17/101), Legal Information Institute, Cornell Law School, accessed November 2026
- [17 U.S. Code section 201: ownership of copyright](https://www.law.cornell.edu/uscode/text/17/201), Legal Information Institute, Cornell Law School, accessed November 2026
- [17 U.S. Code section 204: execution of transfers of copyright ownership](https://www.law.cornell.edu/uscode/text/17/204), Legal Information Institute, Cornell Law School, accessed November 2026
- [Copyright, Designs and Patents Act 1988, section 11](https://www.legislation.gov.uk/ukpga/1988/48/section/11), legislation.gov.uk, accessed November 2026
- [Copyright, Designs and Patents Act 1988, section 90](https://www.legislation.gov.uk/ukpga/1988/48/section/90), legislation.gov.uk, accessed November 2026

---

Book a free consultation: https://sellmydatatoai.net/book-a-consultation